Antwort

1

Die LogonWorkstations -Eigenschaft ist eine durch Kommas getrennte Zeichenfolge. Sie können daher ihren Wert abrufen und dann die neue Arbeitsstation hinzufügen, bevor Sie sie zuweisen.

$User = "xyz" 
$NewWorkstation = "Workstation03" 

$LogonWorkstations = Get-AdUser -Identity $User -Properties LogonWorkstations | select -ExpandProperty LogonWorkstations #get current computernames that user can access 

if ($LogonWorkstations) { 
    Set-ADUser -Identity $User -LogonWorkstations "$LogonWorkstations,$NewWorkstation" #add new workstation to existing entries 
} 
else { 
    Set-ADUser -Identity $User -LogonWorkstations $NewWorkstation #only add new workstation 
} 
+0

Danke !! Es funktionierte :) –

Verwandte Themen