Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

update company field of group members

$
0
0

this should be simple...but i'm having problems getting it done. I could do this if i exported to a csv and then imported that but i'd like to do this on the "fly" ...plus i'd learn something new!

basically trying to get members of an ad group and update the company name field of each member, i've tried different ways of looping but cant get it to work.  thanks for the help

here's my last attempt

      $users = Get-ADGroupMember -Identity testgroup -Recursive 
      where {$_.enabled -eq $true} | `
      Set-ADUser -Identity $users.SamAccountName -Company "test company"


 

 

 


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>