everything was right except the format of the txt file - doh!!
#hidden space Stuart Watret Offshore - IT Ltd ________________________________ From: [email protected] <[email protected]> on behalf of Stuart Watret <[email protected]> Sent: 20 May 2015 13:31 To: <[email protected]> Subject: [mssms] OT Powershell Any thoughts on this? Using Set-DhcpServerv4Option Value to change dns search order on a list of dhcp subnets. I have the list in a txt file, and am assigning a parameter to get-content to read them in. It's fine, except the -scopeId parameter is complaining it can't convert the System.Object[] to type System.Net.IPAddress. I have googled a while and I'm not finding anything - any thoughts? Script: $id = Get-Content D:\temp\file.txt Set-DhcpServerv4OptionValue -computername xxxxx -ScopeId $id -DNSServer x.x.x.x Error: Cannot convert the "System.Object[]" value of type "System.Object[] to type "System.Net.IPAddress" I'm sure it's a simple thing I have yet to come across :) Stuart Watret Offshore - IT Ltd
