Move Computers Automatically to respective OUs


hi

in company using same name both computer , user. have added dot between first name , last name in user name because of huge volume. example michael.strauss. same change have done in computer object also. since computer name not allow dot put _ (underscore) michael_strauss.

we have default ou putting computer objects. but users lies in separate ous based on department. later move computer objects manually respective ous

lets come requirement. have ou named hr. under have hr login accounts contains users , hr computer accounts contains computer objects. we need script automate process. if adding computer in domain first go default ou, once script runs should move concerned ou based on user name match. 2 criterias. if computer name same user name or computer object has underscore dot included in user objects.

could me create script this. tried lot. dot , underscore giving me struggle.





shanif salim

join computer domain , move correct ou.

add-computer -domainname domain02 -oupath 'ou=testou,dc=domain,dc=domain,dc=com'


\_(ツ)_/



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

2008 Windows Deployment Server Properties Error

Can no longer user MS Update - Files required to use Microsoft Update are no longer registered

How do a find data in one file, search for it in another file and if not found, write a custom message to another file