Modify AD Accounts, PowerShell

mvalencia2003
mvalencia2003 used Ask the Experts™
on
Is there a way to modify AD Accounts: add a set of groups, add a home drive path, info into Notes in Telephone tab , add a mailbox , add a address to SMTP (Exchange Console) , enable MS Lync account .. by using PowerShell?

Something like this:

Add-PSSnapin -Name Quest.ActiveRoles.ADManagement


Get-QADUser 'username' | Get-QADMemberOf |  % {Add-QADGroupMember -Identity $_ -Member '<newusername>'}

???
Thanks,
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2015
Commented:
Hi mvalencia,

Yes, everything mentioned can be done via powershell. you would need a module or snapin for these though.

enabling the user to use Lync would need the Lync Module, adding a mailbox the Exchange Snapin, and the rest can either be done by Quest Tools or the ActiveDirectory Module.

The commands you are looking for are:
AD:
Add-ADgroupMember  (Group memberships)
Set-ADUser (Add Home Drive Paths, Add Telephone attribute values)

Exchange:
New-Mailbox (To create a user from scratch - You'll still need the AD commands for some attributes)
New-MailUser (Enable a user that is already created)

Lync:
Enable-CSUser (to enable the account to use lync and assign a SIP address)

If you have specific detail you would like to go into, fire away with your questions,

Regards

Guy

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial