Hello,
I'm in the process of updating FRS to DFSR on 47 domain controllers. I'm trying to write a script to search for this file on each domain controller (c:\windows\sysvol\sysvol\reedsmith.com\replication.txt)
I have a CSV with one column that contains the server name. I'm unable to get this script to work. Can anyone advise on what could be the issue? The script is below, and the error message is below the script.
Script:
Import-Csv "h:\temp\dclist.csv " | Foreach {
$server = $_.servername
$path = "c:\windows\sysvol\sysvol\reedsmith.com"
$file = “Replicationtest.txt”
Get-ChildItem -Path $path -Include $file -Recurse -ErrorAction SilentlyContinue -Force |
Select-Object $server, $file }
Error message:
Select-Object : The value of a parameter was null; one of the following types was expected: {System.String,
System.Management.Automation.ScriptBlock}.
At line:8 char:1
+ Select-Object $server, $file }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Select-Object], NotSupportedException
+ FullyQualifiedErrorId : DictionaryKeyUnknownType,Microsoft.PowerShell.Commands.SelectObjectCommand
Select-Object : The value of a parameter was null; one of the following types was expected: {System.String,
System.Management.Automation.ScriptBlock}.
At line:8 char:1
+ Select-Object $server, $file }