MilesLogan
asked on
Script failing if not all columns have data to be updated.
I was helped by an Expert on the script below .. I didn't plan on it but my CSV has blanks on some of the attributes... can someone
assist modifying this so if there is a blank in one of the fields?
so lets say a user only needs 3 of the 4 values below updated , the script below does not work .. it only works if all four fields have values to update.
assist modifying this so if there is a blank in one of the fields?
so lets say a user only needs 3 of the 4 values below updated , the script below does not work .. it only works if all four fields have values to update.
Import-CSV -Path "$env:SystemDrive\Test\temp.csv" | % {
Set-ADUser $_.Username -replace @{'msExchExtensionAttribute24' = $_.msExchExtensionAttribute24; 'msExchExtensionAttribute25' = $_.msExchExtensionAttribute25; 'msExchExtensionAttribute26' = $_.msExchExtensionAttribute26; 'msExchExtensionAttribute27' = $_.msExchExtensionAttribute27; }
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi oBdA .. that worked exactly as expected and thank you for making the script easy to understand .
Open in new window