From bfec04e2c8b39def8c47a2e39b4e4cf3997c0a7a Mon Sep 17 00:00:00 2001 From: Tre Hayes Date: Tue, 21 Dec 2021 19:42:59 -0600 Subject: [PATCH] ChangeCustomADAttributesFromUserList.ps1 --- ChangeCustomADAttributesFromUserList.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 ChangeCustomADAttributesFromUserList.ps1 diff --git a/ChangeCustomADAttributesFromUserList.ps1 b/ChangeCustomADAttributesFromUserList.ps1 new file mode 100644 index 0000000..098c70e --- /dev/null +++ b/ChangeCustomADAttributesFromUserList.ps1 @@ -0,0 +1,12 @@ +#List attribute(s) from a csv list of users +Import-Csv -Path C:\Users\22306-a\Desktop\.csv | ` +foreach {if ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Get-ADUser -Identity $_.'User ID' -Properties | select } ` +elseif ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Get-ADUser -Identity $_.'User ID' -Properties | select } ` +elseif ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Get-ADUser -Identity $_.'User ID' -Properties | select }} + + +#set attribute(s) from a csv list of users +Import-Csv -Path C:\Users\22306-a\Desktop\ChangeVP.csv | ` +foreach {if ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Set-ADUser -Identity $_.'User ID' -replace @{=""} | Get-ADUser -Identity $_.'User ID' -Properties | select } ` +elseif ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Set-ADUser -Identity $_.'User ID' -replace @{=""} | Get-ADUser -Identity $_.'User ID' -Properties | select } ` +elseif ((Get-ADUser -Identity $_.'User ID' -Properties | select ) -like "**") {Set-ADUser -Identity $_.'User ID' -replace @{=""} | Get-ADUser -Identity $_.'User ID' -Properties | select }} \ No newline at end of file