Posts

Showing posts from June, 2014

Power Shell stuff

1.  Replacing characters in csv file using below sample code:

$csv001 = import-csv "C:\Users\sumeet.kumar\Desktop\Services\Scripts\Power Shell Scripts\Sending reboot notification\Computers with last logged on user from collection Username0.csv"
$csv001 | foreach-object {

$_.username0 = $_.username0.replace("Domain\","")
}
$csv001 | export-csv  "C:\Users\sumeet.kumar\Desktop\Services\Scripts\Power Shell Scripts\Sending reboot notification\Computers with last logged on user from collection Username001.csv" -notype


Reference: http://social.technet.microsoft.com/Forums/windowsserver/en-US/0ad9ad37-b99b-418a-b139-34752b0927dc/powershell-importcsv-then-replace-character-then-exportcsv


2.  Appending characters in csv file using below code:

$csv003 = import-csv "C:\Users\sumeet.kumar\Desktop\Services\Scripts\Power Shell Scripts\Sending reboot notification\Computers with last logged on user from collection Username001.csv"
$csv003 | foreach-object {

'Failed to insert OSD binaries into the WIM file' when injecting network drivers into Boot Image SCCM 2012