|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
powershell storage managementdrive letters are Z,M,N,D,G. This is the code I'm currently using to display information about my servers. $strComputer = "servername" $colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root\CIMV2" ` -computername $strComputer foreach ($objItem in $colItems) { write-host "Caption: " $objItem.Caption write-host "Compressed: " $objItem.Compressed write-host "Description: " $objItem.Description write-host "Device ID: " $objItem.DeviceID write-host "File System: " $objItem.FileSystem write-host "Free Space: " $objItem.FreeSpace write-host "Name: " $objItem.Name write-host "Provider Name: " $objItem.ProviderName write-host "Size: " $objItem.Size write-host "System Name: " $objItem.SystemName write-host "Volume Name: " $objItem.VolumeName write-host } On Dec 31 2008, 9:02 am, IT <IT @discussions.microsoft.com> wrote:
Show quoteHide quote > I need to filter out the shared drives in this script located below. The If you only want the physical drives on your server, then -filter> drive letters are Z,M,N,D,G. This is the code I'm currently using to display > information about my servers. > > $strComputer = "servername" > > $colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root\CIMV2" ` > -computername $strComputer > > foreach ($objItem in $colItems) { > write-host "Caption: " $objItem.Caption > write-host "Compressed: " $objItem.Compressed > write-host "Description: " $objItem.Description > write-host "Device ID: " $objItem.DeviceID > write-host "File System: " $objItem.FileSystem > write-host "Free Space: " $objItem.FreeSpace > write-host "Name: " $objItem.Name > write-host "Provider Name: " $objItem.ProviderName > write-host "Size: " $objItem.Size > write-host "System Name: " $objItem.SystemName > write-host "Volume Name: " $objItem.VolumeName > write-host > > } DriveType=3 On 31 Dez. 2008, 16:02, IT <IT @discussions.microsoft.com> wrote:
Show quoteHide quote > I need to filter out the shared drives in this script located below. The Hi IT,> drive letters are Z,M,N,D,G. This is the code I'm currently using to display > information about my servers. > > $strComputer = "servername" > > $colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root\CIMV2" ` > -computername $strComputer > > foreach ($objItem in $colItems) { > write-host "Caption: " $objItem.Caption > write-host "Compressed: " $objItem.Compressed > write-host "Description: " $objItem.Description > write-host "Device ID: " $objItem.DeviceID > write-host "File System: " $objItem.FileSystem > write-host "Free Space: " $objItem.FreeSpace > write-host "Name: " $objItem.Name > write-host "Provider Name: " $objItem.ProviderName > write-host "Size: " $objItem.Size > write-host "System Name: " $objItem.SystemName > write-host "Volume Name: " $objItem.VolumeName > write-host > > > > }- Zitierten Text ausblenden - > > - Zitierten Text anzeigen - pipe the WMI to the folowing Filter: ? {$_.DeviceID -notmatch "[Z|M|N|D|G]"} Complete line of Code: $colItems = get-wmiobject -class "Win32_LogicalDisk" -namespace "root \CIMV2" -computername $strComputer | ? {$_.DeviceID -notmatch "[Z|M|N| D|G]"} So all Drives wich NOT match are assigned to $colItems
This script doesn't work i don't know why
Special batchfile Re: lastLogonTimestamp not set! Is there any way to control the Transport Server (subcomponent of Windows Deployment Services) via P DISKPART select command doesn't have a "noerr" command for scripti exporting * importing users into groups script to extract and create contacts How to Modify AD CN Field Stored Passwords in Internet Explorer How to run a script by a domain user ? |
|||||||||||||||||||||||