Announcement

Collapse
No announcement yet.

Powershell command for changing company detail

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Powershell command for changing company detail

    Hi All,

    I have the unenviable task of cleaning up our AD

    Is there a Powershell command to replace any AD users account with 'Company A' listed in the company attribute field (under Organisation tab in user account properties) with the new 'Company B' name?

    Thanks
    Richard

  • #2

    dsquery * -filter "&((objectCategory=Person)(objectClass=User)(compa ny=*OLDCOMPANY))" -limit 0 | dsmod user -company "%NEWCOMPANY%

    Comment


    • #3
      Since this is the Powershell forum....

      Code:
      Get-ADUser -Filter {company -eq 'Company A'} | Set-ADUser -Company 'Company B'
      How many users are you dealing with?
      Regards,
      Jeremy

      Network Consultant/Engineer
      Baltimore - Washington area and beyond
      www.gma-cpa.com

      Comment

      Working...
      X