February 24, 2011 at 11:16 am
hello, I run this command for a remote computer :
Get-WmiObject -computer $srv -Class Win32_LogicalDisk –filter "DriveType=3"
this command works great, but I have a problem to run this command for instance name.
I know that there is parmater called -namespace. but I need to tun this command for both
computer and instance name.
mybe, someone know any command or paramater that work for both.
thank's, kln
March 3, 2011 at 5:45 am
what exactly do you mean when you specify that you need to run it on the instance. Can you provide an example of the instance name on which you want to run.
Or else is it something like
Instance name : ABC\XYZ
and you want the logical drive information of all the drives present on server ABC?
then you can do something like this :
[System.Reflection.Assembly]::LoadWithPartialName(’Microsoft.SqlServer.SMO’) | Out-Null
$smo = New-Object (’Microsoft.SqlServer.Management.Smo.Server’)"ABC\XYZ"
Get-WmiObject -computer $smo.ComputerNamePhysicalNetBIOS -Class Win32_LogicalDisk –filter "DriveType=3"
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy