It still never worked properly, moved to vb and wrapped netsh - 15mins and 
done.  Powershell - lost in the pipeline :)

From: [email protected] [mailto:[email protected]] On 
Behalf Of Atkinson, Matt T
Sent: 20 May 2015 16:23
To: [email protected]
Subject: [mssms] RE: OT Powershell

I wind up using .trim() almost as a default on my input files these days.

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Stuart Watret
Sent: Wednesday, May 20, 2015 5:43 AM
To: [email protected]<mailto:[email protected]>
Subject: [mssms] Re: OT Powershell


everything was right except the format of the txt file - doh!!



#hidden space



Stuart Watret

Offshore - IT Ltd

________________________________
From: [email protected]<mailto:[email protected]> 
<[email protected]<mailto:[email protected]>> on 
behalf of Stuart Watret 
<[email protected]<mailto:[email protected]>>
Sent: 20 May 2015 13:31
To: <[email protected]<mailto:[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



________________________________

This message is intended for the sole use of the addressee, and may contain 
information that is privileged, confidential and exempt from disclosure under 
applicable law. If you are not the addressee you are hereby notified that you 
may not use, copy, disclose, or distribute to anyone the message or any 
information contained in the message. If you have received this message in 
error, please immediately advise the sender by reply email and delete this 
message.




Reply via email to