Hi,
I'm writing a script which builds a AD Domain Structure.
In order to build a Site/Subnet structure, I import a list of Subnets from a csv file and, before creating the subnet, I checked if it does not already exist. The problem is that the cmdlet does not interpret information retrieved from the csv file.
$SitesToCreate = import-csv $filePath -Delimiter ";" Foreach($Site in $SitesToCreate){ if (!$(Get-ADReplicationSubnet -Filter {Name -eq $Site.Subnet})) { New-ADReplicationSubnet -Name $Site.Subnet -Site $Site.Name -Location $($Site.Country+ "\" +$Site.Name) } }
The error returned by the script engine is the following :
Get-ADReplicationSubnet : Property: 'Subnet' not found in object of type: 'System.Management.Automation.PSCustomObject'.
obviously the property "subnet" exists.
Do you have any idea about the error ?
By advance, Thank you