Hey Guys,
I am new to powershell but have consulted the help docs and a few forums but i am very stuck with this.
The below script lets me set the $userinstance variable for the -instance syntax and then i have prompts for some other fields i would like overwritten. the outcome is the account is created but only with the variables that i’ve set, there is no department, groupings etc. set
I am then trying to set the msRTCSIP-PrimaryUserAddress so it wil work with lync online but it fails with “‘set-QADObject : The term ‘set-QADObject’ is not recognized as the name of a cmdlet, function, script file, or operable program.’”
am i meant to load a new cmdlet for QADobject to work?
$userInstance = Get-ADuser -Identity (Read-Host “Target Username”)
$firstname = Read-Host “First Name”
$Lastname = Read-Host “Last Name”
$Username = Read-Host “username”
$NewName = "$lastname, $firstname "
$NewUser = “$firstname.$Lastname@pgi.com”
New-ADUser -Name $NewName -Instance $userInstance -SamAccountName $Username -GivenName $firstname -Surname $lastname -UserPrincipalName $NewUser -AccountPassword (Read-Host “New Password” -AsSecureString)
set-QADObject -identity $Username.Alias_Name -ObjectAttribute @{“msRTCSIP-PrimaryUserAddress”=sip:$NewUser}