Hey,
To make it easy: I'm creating a new user and I need to define one computer that can log on to it in the User Properties > Account > Log on to..
This is the current script:
$Cred = Get-Credential $Template = Get-AdUser -identity "account_C" $Computers = Get-Content ".\Computers.txt" $Password = "Pa$$w0rd" $Domain = "domain.no" $OU = "OU=Autologon,OU=SystemUsers,OU=Admin,DC=domain,DC=no" Foreach ($Computer in $Computers) { $Newbie = "account_$computer" $UPN = "$Newbie $Domain" -Replace " ","@" New-AdUser -name $Newbie -SamAccountName $Newbie -Instance $Template -UserPrincipalName $UPN -GivenName $Newbie -AccountPassword $Password -ChangePasswordAtLogon $False -DisplayName $Newbie -Enabled $True -Server $Domain -Path $Path -Cred $Cred -enable $True -CannotChangePassword $True -PasswordNeverExpires $True }