Quantcast
Channel: Active Directory Forum
Viewing all articles
Browse latest Browse all 1144

Worter in CSV Datei mit PowerShell ändern

$
0
0

Hallo 

ich möchte bestimmte Wörter in CSV-Datei ädern aber es klappt nicht. 


$BenutzerListe = C:\Users\Administrator\Documents\Benutzer.csv
$myPatern = "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection"
$meinPassword = "Pa$$wort"

Get-Content -Path $BenutzerListe | foreach {
    if($_ -match $myPatern)
    {
        $_ -replace $myPatern, "$meinPassword"
    }
  }

Und Die Fehlermeldung auch 

Get-Content : Cannot bind argument to parameter 'Path' because it is null.
At line:5 char:19+ Get-Content -Path $BenutzerListe | foreach {+                   ~~~~~~~~~~~~~~+ CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.GetContentCommand

Anscheinend wird die Datei nicht gelesen. 

Wie behebe ich diese Fehlermeldung? 


Viewing all articles
Browse latest Browse all 1144


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>