Hi I am totally lost maybe someone can shine some light on this…
what i am trying to accomplish: Our Home directory is currently mapped to this path like this \MainServerBob.jones For our users
What I am looking to do is change the Path to include the domain name after the server name like: \MainServer.MyDomainBob.Jones by replacing the original
server name with the sever name and domain name. then adding after it the what ever appears after the 12 character
Here is what i have been trying to use
Get-ADUser -SearchBase ‘OU=Test,DC=mydomain,DC=com’ -LDAPFilter "(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)(homeDirectory=*))" -Properties HomeDirectory | ForEach-Object Set-ADUser -Replace @{homeDirectory="\MainServer.MyDomain.coms($_.homeDirectory.substring(12))"}
On the left side of the pipe i am trying to limit the selection to only users that have an existing path, and the account is active. that part seems to work fine.
the right side is a mess (maybe a left side too )
I would really appreciate any help i can get
Thanks
Tom