Mark Minasi's Tech Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
meloao

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 95
Reply with quote  #1 
When attempting to run the command below, I get an error stating that "You cannot call a method on a null-valued expression."  The command is supposed to change the mail attribute to all lowercase letters in $ou.


Get-ADUser -Filter * -SearchBase $ou | ForEach-Object {Set-ADUser -Identity $_.samaccountname -EmailAddress $_.mail.ToLower()}
0
meloao

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 95
Reply with quote  #2 
Ah! Figured it out  I needed to include     -Properties mail
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.