From 1c2bd5d0d33a4e0f98a9c80f0548307de0e129d2 Mon Sep 17 00:00:00 2001 From: Tre Hayes Date: Tue, 21 Dec 2021 19:47:27 -0600 Subject: [PATCH] Update 'README.md' --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fdb4e97..bbf979b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ # Change_AD_Custom_Attributes -List or change custom Active Directory attributes \ No newline at end of file +List or change custom Active Directory attributes + + +#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