Kopfan A
asked on
Powershell Script on a CSV file
Powershell Script to change particular attribute
I have the following script :
import-module activedirectory
Get-ADUser -SearchBase "OU=exampme,OU=example,DC= example,DC =co,DC=uk" -Filter * | ForEach-Object {
$User = [ADSI]"LDAP://$($_.Disting uishedName )"
$User.psbase.invokeset("Te rminalServ icesProfil ePath","C: \PooledVDI Config\Man datoryProf ile")
$User.setinfo()
}
The above works fine for all objects in an OU - I would like to run the above on a csv file which has First name and Last name
Any idea how this can be done?
I have the following script :
import-module activedirectory
Get-ADUser -SearchBase "OU=exampme,OU=example,DC=
$User = [ADSI]"LDAP://$($_.Disting
$User.psbase.invokeset("Te
$User.setinfo()
}
The above works fine for all objects in an OU - I would like to run the above on a csv file which has First name and Last name
Any idea how this can be done?
ASKER
Thank you Michael, very helpful.
In regards to the line where it looks in the OU - we have multiple 'user OU's' that these listed users may be in - any idea how that will work - for it to search more than 1 OU?
Regards,
Kopfan
In regards to the line where it looks in the OU - we have multiple 'user OU's' that these listed users may be in - any idea how that will work - for it to search more than 1 OU?
Regards,
Kopfan
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
No feedback from asker, solution should work
Open in new window
Open in new window