Question: How to enable AD user account using Windows PowerShell cmdlets?
Answer (shamelessly stolen from Andrei’s post in the PowerGUI discussion forum):
1. [If this is a new account] Create the account using New-QADUser. Make sure the password is also set (-UserPassword parameter)
2. Enable the account by setting userAccountControl to 512: e.g.
Set-QADUser TEST\testuser -ObjectAttributes @{userAccountControl=512}
Bulk account provisioning:
If you want to do that in bulk using csv file for bulk user account provisioning this might (depending on the columns in your file and attributes being set) look like:
PS C:\> Import-Csv users.csv | ForEach-Object {New-QADUser -ou acme.local/demo -name $_.Name -UserPassword $_.Password
PS C:\> Import-Csv users.csv | ForEach-Object {Set-QADUser $_.Name -ObjectAttributes @{userAccountControl=512}}
Due to AD cmdlets not having a community site of their own we have created a forum for Active Directory PowerShell discussions on PowerGUI.org. Andrei and other members of his team are there for your questions, feature requests, etc.
Tags: AD cmdlets, provisioning, PowerShell, Active Directory, AD
Subscribe by email






when i open the control panel & click on user accounts a blank page comes up. How do i get into user accounts??
It looks like we are actually talking about different types of accounts. I am primarily writing about Active Directory management - so these are the accounts which administrators set up in enterprise networks.
It looks like you are asking about local accounts on a Windows XP (or Vista) computer. While I am not a specialist at troubleshooting such issues one of the possible reasons might be your lack of administrative privileges on the computer. Try logging in as an administrator and see if you can now see all accounts (it might take a few seconds before the list gets populated.)
Thank you but in order to login in as an administrator i have to get into the user account in the control panel which i cannot do. The screen comes up blank but on top it says “screen name server” & i don’t have a clue what that means.
I found a few posts on the internet mentioning the same problem but none seems to suggest a good workaround so you might have to roll-back to a previously saved system state or even reinstall Windows if none of these help (and you can’t use Microsoft’s tech support):
http://windowsxp.mvps.org/useracc.htm
http://forums.techguy.org/windows-nt-2000-xp/586157-user-accounts-folder-empty.html