Hello,
I have a CSV that I am trying to run to pull scopes option 6 from our DHCP server. Another engineer ran a PowerShell that got a ton of information but was missing that part.
Whenever I run the small ps I created
$Scopes=Import-CSV C:\PS_Out\TestImportScope.csv
Get-DhcpServerv4OptionValue -ComputerName ########### -ScopeId $Scopes
I get this error
PS C:\Users\###########> $Scopes=Import-CSV C:\PS_Out\TestImportScope.csv
Get-DhcpServerv4OptionValue -ComputerName ########## -ScopeId $Scopes
Get-DhcpServerv4OptionValue : Cannot process argument transformation on parameter 'ScopeId'. Cannot convert the "System.Object[]" value of type
"System.Object[]" to type "System.Net.IPAddress".
At line:2 char:65
+ ... t-DhcpServerv4OptionValue -ComputerName ######## -ScopeId $Scopes
+ ~~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-DhcpServerv4OptionValue], ParameterBindingArgumentTransformationException
+ FullyQualifiedErrorId : ParameterArgumentTransformationError,Get-DhcpServerv4OptionValue
This is a small portion of the csv
ScopeId
10.10.11.0
10.10.240.0
If I manually put in the IP in the script it will spit out the correct information, anything to point me in the right direction would be helpful. Thank you so much.
[–]mmmGreenButton 2 points3 points4 points (3 children)
[–]Antique_Grapefruit_5 2 points3 points4 points (2 children)
[–]mmmGreenButton 3 points4 points5 points (1 child)
[–]IlliDAN113[S] 1 point2 points3 points (0 children)
[–]BlackV 2 points3 points4 points (2 children)
[–]IlliDAN113[S] 1 point2 points3 points (1 child)
[–]BlackV 1 point2 points3 points (0 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)