Run your script with elevated privileges. I.e., start Powershell with "Run as administrator".
As a regular user you may not have the necessary permission to access the state of those users.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to read the "Enabled" field of user account information using Powershell Get-ADUser.
Here is the command that I used:
Get-ADUser -SearchBase "OU=Marketing,OU=Users,OU=Apple,DC=Orange,DC=Grape,DC=uk" -Filter * -Properties Enabled | select-object SAMAccountName, Enabled
And I got this kind of results:
SAMAccountName Enabled
--------------------- ---------
User1 True
User2 True
User3
User4 False
User5 True
User6
User7 False
Why some of the users returned "blank" for the "Enabled" field? I searched from the same OU. I got True and False results from some users though.
Run your script with elevated privileges. I.e., start Powershell with "Run as administrator".
As a regular user you may not have the necessary permission to access the state of those users.