Getting Success/Failure Response from PowerShell Enable/Disable User script -


how success/failure response powershell enable/disable user using following scripts.i need update status of user.

get-aduser -filter mail -eq $mail | disable-adaccount get-aduser -filter 'mail -eq "ed@gmail.com"' | enable-adaccount  

please advice me resolve this.

just add -passthru parameter enable-adaccount , pass user object along properties. want select enabled user property.

get-aduser -filter 'mail -eq "ed@gmail.com"' |      enable-adaccount -passthru | select-object enabled 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -