Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: View free space harddisk on remote PC

HTVi
TV Discussion Newsgroups

View free space harddisk on remote PC
Saitor 5/14/2007 4:57:00 AM
Hi all,

On every week we must provide free space hardisk information. Ihave tried to
run this script :

------------
Option Explicit

Const HARD_DISK = 3
Dim arrArgs, strComputer, objWMIService, colDisks, objDisk, lngFreeSpace

Set arrArgs = WScript.Arguments
If arrArgs.Count = 1 Then
strComputer = arrArgs(0)
Else
strComputer = InputBox("Enter the Computer Name to check Free HD Space:",
"Computer Name", strComputer)
End If

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colDisks = objWMIService.ExecQuery _
("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")

For Each objDisk In colDisks
lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
"Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
"Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
Next
--------------

But everytime I type IP or Computer Name for the server which we want view,
there is message permission dened:'Get Object".
And this is not happen if we put the local server.

What scripts that must I have to added for view free space on remote PC.
many thanks for your kindness.

Re: View free space harddisk on remote PC
"CreateWindow" <createwindow[ at ]gmail.com> 5/14/2007 7:08:19 AM
Hi Saitor,

Windows firewall on remote machines is probably blocking the RPC calls
needed for WMI.
Try turning off the FW on one of the remote machines - and if it works - you
will need to make exceptions in the firewall.

CreateWindow
http://mymessagetaker.com
Stop using those paper phone message pads
make the computer work for you.
http://justpageprobe.com
The FREE Web page utility you always wanted.
Monitor your enterprise Web Servers.
Keep your router connected.
Email your IP to where you need it.


"Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
[Quoted Text]
> Hi all,
>
> On every week we must provide free space hardisk information. Ihave tried
> to
> run this script :
>
> ------------
> Option Explicit
>
> Const HARD_DISK = 3
> Dim arrArgs, strComputer, objWMIService, colDisks, objDisk, lngFreeSpace
>
> Set arrArgs = WScript.Arguments
> If arrArgs.Count = 1 Then
> strComputer = arrArgs(0)
> Else
> strComputer = InputBox("Enter the Computer Name to check Free HD
> Space:",
> "Computer Name", strComputer)
> End If
>
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
>
> Set colDisks = objWMIService.ExecQuery _
> ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")
>
> For Each objDisk In colDisks
> lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
> Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
> "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
> "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
> Next
> --------------
>
> But everytime I type IP or Computer Name for the server which we want
> view,
> there is message permission dened:'Get Object".
> And this is not happen if we put the local server.
>
> What scripts that must I have to added for view free space on remote PC.
> many thanks for your kindness.
>


Re: View free space harddisk on remote PC
Saitor 5/14/2007 7:30:00 AM
Thanks for your appreciate

But It seems on the remote server/PC there is no Windows Firewall running on
Win2003 server or Win2k. And we already make sure the RPC service is running.
Any probably can help ?

Thanks


"CreateWindow" wrote:

[Quoted Text]
> Hi Saitor,
>
> Windows firewall on remote machines is probably blocking the RPC calls
> needed for WMI.
> Try turning off the FW on one of the remote machines - and if it works - you
> will need to make exceptions in the firewall.
>
> CreateWindow
> http://mymessagetaker.com
> Stop using those paper phone message pads
> make the computer work for you.
> http://justpageprobe.com
> The FREE Web page utility you always wanted.
> Monitor your enterprise Web Servers.
> Keep your router connected.
> Email your IP to where you need it.
>
>
> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
> news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
> > Hi all,
> >
> > On every week we must provide free space hardisk information. Ihave tried
> > to
> > run this script :
> >
> > ------------
> > Option Explicit
> >
> > Const HARD_DISK = 3
> > Dim arrArgs, strComputer, objWMIService, colDisks, objDisk, lngFreeSpace
> >
> > Set arrArgs = WScript.Arguments
> > If arrArgs.Count = 1 Then
> > strComputer = arrArgs(0)
> > Else
> > strComputer = InputBox("Enter the Computer Name to check Free HD
> > Space:",
> > "Computer Name", strComputer)
> > End If
> >
> > Set objWMIService = GetObject("winmgmts:" _
> > & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
> >
> > Set colDisks = objWMIService.ExecQuery _
> > ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK & "")
> >
> > For Each objDisk In colDisks
> > lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
> > Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
> > "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
> > "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
> > Next
> > --------------
> >
> > But everytime I type IP or Computer Name for the server which we want
> > view,
> > there is message permission dened:'Get Object".
> > And this is not happen if we put the local server.
> >
> > What scripts that must I have to added for view free space on remote PC.
> > many thanks for your kindness.
> >
>
>
>
Re: View free space harddisk on remote PC
"CreateWindow" <createwindow[ at ]gmail.com> 5/14/2007 7:36:08 AM
Hi,

So you are using an account that has the required privileges?

CW

"Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
news:4AAD1259-EEA6-473D-A20D-5292BE8B48EA[ at ]microsoft.com...
[Quoted Text]
> Thanks for your appreciate
>
> But It seems on the remote server/PC there is no Windows Firewall running
> on
> Win2003 server or Win2k. And we already make sure the RPC service is
> running.
> Any probably can help ?
>
> Thanks
>
>
> "CreateWindow" wrote:
>
>> Hi Saitor,
>>
>> Windows firewall on remote machines is probably blocking the RPC calls
>> needed for WMI.
>> Try turning off the FW on one of the remote machines - and if it works -
>> you
>> will need to make exceptions in the firewall.
>>
>> CreateWindow
>> http://mymessagetaker.com
>> Stop using those paper phone message pads
>> make the computer work for you.
>> http://justpageprobe.com
>> The FREE Web page utility you always wanted.
>> Monitor your enterprise Web Servers.
>> Keep your router connected.
>> Email your IP to where you need it.
>>
>>
>> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
>> news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
>> > Hi all,
>> >
>> > On every week we must provide free space hardisk information. Ihave
>> > tried
>> > to
>> > run this script :
>> >
>> > ------------
>> > Option Explicit
>> >
>> > Const HARD_DISK = 3
>> > Dim arrArgs, strComputer, objWMIService, colDisks, objDisk,
>> > lngFreeSpace
>> >
>> > Set arrArgs = WScript.Arguments
>> > If arrArgs.Count = 1 Then
>> > strComputer = arrArgs(0)
>> > Else
>> > strComputer = InputBox("Enter the Computer Name to check Free HD
>> > Space:",
>> > "Computer Name", strComputer)
>> > End If
>> >
>> > Set objWMIService = GetObject("winmgmts:" _
>> > & "{impersonationLevel=impersonate}!\\" & strComputer &
>> > "\root\cimv2")
>> >
>> > Set colDisks = objWMIService.ExecQuery _
>> > ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK &
>> > "")
>> >
>> > For Each objDisk In colDisks
>> > lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
>> > Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
>> > "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
>> > "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
>> > Next
>> > --------------
>> >
>> > But everytime I type IP or Computer Name for the server which we want
>> > view,
>> > there is message permission dened:'Get Object".
>> > And this is not happen if we put the local server.
>> >
>> > What scripts that must I have to added for view free space on remote
>> > PC.
>> > many thanks for your kindness.
>> >
>>
>>
>>


Re: View free space harddisk on remote PC
Saitor 5/14/2007 7:57:01 AM
Hi,

The server is the same domain with PC to execute this script. So do you have
any idea if the account does not required privilege when we execute

"Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK"


Saitor

"CreateWindow" wrote:

[Quoted Text]
> Hi,
>
> So you are using an account that has the required privileges?
>
> CW
>
> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
> news:4AAD1259-EEA6-473D-A20D-5292BE8B48EA[ at ]microsoft.com...
> > Thanks for your appreciate
> >
> > But It seems on the remote server/PC there is no Windows Firewall running
> > on
> > Win2003 server or Win2k. And we already make sure the RPC service is
> > running.
> > Any probably can help ?
> >
> > Thanks
> >
> >
> > "CreateWindow" wrote:
> >
> >> Hi Saitor,
> >>
> >> Windows firewall on remote machines is probably blocking the RPC calls
> >> needed for WMI.
> >> Try turning off the FW on one of the remote machines - and if it works -
> >> you
> >> will need to make exceptions in the firewall.
> >>
> >> CreateWindow
> >> http://mymessagetaker.com
> >> Stop using those paper phone message pads
> >> make the computer work for you.
> >> http://justpageprobe.com
> >> The FREE Web page utility you always wanted.
> >> Monitor your enterprise Web Servers.
> >> Keep your router connected.
> >> Email your IP to where you need it.
> >>
> >>
> >> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
> >> news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
> >> > Hi all,
> >> >
> >> > On every week we must provide free space hardisk information. Ihave
> >> > tried
> >> > to
> >> > run this script :
> >> >
> >> > ------------
> >> > Option Explicit
> >> >
> >> > Const HARD_DISK = 3
> >> > Dim arrArgs, strComputer, objWMIService, colDisks, objDisk,
> >> > lngFreeSpace
> >> >
> >> > Set arrArgs = WScript.Arguments
> >> > If arrArgs.Count = 1 Then
> >> > strComputer = arrArgs(0)
> >> > Else
> >> > strComputer = InputBox("Enter the Computer Name to check Free HD
> >> > Space:",
> >> > "Computer Name", strComputer)
> >> > End If
> >> >
> >> > Set objWMIService = GetObject("winmgmts:" _
> >> > & "{impersonationLevel=impersonate}!\\" & strComputer &
> >> > "\root\cimv2")
> >> >
> >> > Set colDisks = objWMIService.ExecQuery _
> >> > ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK &
> >> > "")
> >> >
> >> > For Each objDisk In colDisks
> >> > lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
> >> > Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
> >> > "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
> >> > "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
> >> > Next
> >> > --------------
> >> >
> >> > But everytime I type IP or Computer Name for the server which we want
> >> > view,
> >> > there is message permission dened:'Get Object".
> >> > And this is not happen if we put the local server.
> >> >
> >> > What scripts that must I have to added for view free space on remote
> >> > PC.
> >> > many thanks for your kindness.
> >> >
> >>
> >>
> >>
>
>

Re: View free space harddisk on remote PC
"CreateWindow" <createwindow[ at ]gmail.com> 5/14/2007 9:56:13 AM
Hi,

Generally you need to have local administrator privileges on the remote
machine.
Ports 135 and 1162 must be open on the remote machine or - as you
mentioned - no firewall.

That should work.

Cheers,
CreateWindow


"Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
news:69088589-1FA8-48E3-B63E-5ECFA0E7556C[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> The server is the same domain with PC to execute this script. So do you
> have
> any idea if the account does not required privilege when we execute
>
> "Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK"
>
>
> Saitor
>
> "CreateWindow" wrote:
>
>> Hi,
>>
>> So you are using an account that has the required privileges?
>>
>> CW
>>
>> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
>> news:4AAD1259-EEA6-473D-A20D-5292BE8B48EA[ at ]microsoft.com...
>> > Thanks for your appreciate
>> >
>> > But It seems on the remote server/PC there is no Windows Firewall
>> > running
>> > on
>> > Win2003 server or Win2k. And we already make sure the RPC service is
>> > running.
>> > Any probably can help ?
>> >
>> > Thanks
>> >
>> >
>> > "CreateWindow" wrote:
>> >
>> >> Hi Saitor,
>> >>
>> >> Windows firewall on remote machines is probably blocking the RPC calls
>> >> needed for WMI.
>> >> Try turning off the FW on one of the remote machines - and if it
>> >> works -
>> >> you
>> >> will need to make exceptions in the firewall.
>> >>
>> >> CreateWindow
>> >> http://mymessagetaker.com
>> >> Stop using those paper phone message pads
>> >> make the computer work for you.
>> >> http://justpageprobe.com
>> >> The FREE Web page utility you always wanted.
>> >> Monitor your enterprise Web Servers.
>> >> Keep your router connected.
>> >> Email your IP to where you need it.
>> >>
>> >>
>> >> "Saitor" <Saitor[ at ]discussions.microsoft.com> wrote in message
>> >> news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
>> >> > Hi all,
>> >> >
>> >> > On every week we must provide free space hardisk information. Ihave
>> >> > tried
>> >> > to
>> >> > run this script :
>> >> >
>> >> > ------------
>> >> > Option Explicit
>> >> >
>> >> > Const HARD_DISK = 3
>> >> > Dim arrArgs, strComputer, objWMIService, colDisks, objDisk,
>> >> > lngFreeSpace
>> >> >
>> >> > Set arrArgs = WScript.Arguments
>> >> > If arrArgs.Count = 1 Then
>> >> > strComputer = arrArgs(0)
>> >> > Else
>> >> > strComputer = InputBox("Enter the Computer Name to check Free HD
>> >> > Space:",
>> >> > "Computer Name", strComputer)
>> >> > End If
>> >> >
>> >> > Set objWMIService = GetObject("winmgmts:" _
>> >> > & "{impersonationLevel=impersonate}!\\" & strComputer &
>> >> > "\root\cimv2")
>> >> >
>> >> > Set colDisks = objWMIService.ExecQuery _
>> >> > ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK
>> >> > &
>> >> > "")
>> >> >
>> >> > For Each objDisk In colDisks
>> >> > lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
>> >> > Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
>> >> > "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
>> >> > "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
>> >> > Next
>> >> > --------------
>> >> >
>> >> > But everytime I type IP or Computer Name for the server which we
>> >> > want
>> >> > view,
>> >> > there is message permission dened:'Get Object".
>> >> > And this is not happen if we put the local server.
>> >> >
>> >> > What scripts that must I have to added for view free space on remote
>> >> > PC.
>> >> > many thanks for your kindness.
>> >> >
>> >>
>> >>
>> >>
>>
>>
>


Re: View free space harddisk on remote PC
addy <aditya.n.kapur[ at ]gmail.com> 5/15/2007 9:56:09 PM
On May 14, 2:56 pm, "CreateWindow" <createwin...[ at ]gmail.com> wrote:
[Quoted Text]
> Hi,
>
> Generally you need to have local administrator privileges on the remote
> machine.
> Ports 135 and 1162 must be open on the remote machine or - as you
> mentioned - no firewall.
>
> That should work.
>
> Cheers,
> CreateWindow
>
> "Saitor" <Sai...[ at ]discussions.microsoft.com> wrote in message
>
> news:69088589-1FA8-48E3-B63E-5ECFA0E7556C[ at ]microsoft.com...
>
>
>
> > Hi,
>
> > The server is the same domain with PC to execute this script. So do you
> > have
> > any idea if the account does not required privilege when we execute
>
> > "Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK"
>
> > Saitor
>
> > "CreateWindow" wrote:
>
> >> Hi,
>
> >> So you are using an account that has the required privileges?
>
> >> CW
>
> >> "Saitor" <Sai...[ at ]discussions.microsoft.com> wrote in message
> >>news:4AAD1259-EEA6-473D-A20D-5292BE8B48EA[ at ]microsoft.com...
> >> > Thanks for your appreciate
>
> >> > But It seems on the remote server/PC there is no Windows Firewall
> >> > running
> >> > on
> >> > Win2003 server or Win2k. And we already make sure the RPC service is
> >> > running.
> >> > Any probably can help ?
>
> >> > Thanks
>
> >> > "CreateWindow" wrote:
>
> >> >> Hi Saitor,
>
> >> >> Windows firewall on remote machines is probably blocking the RPC calls
> >> >> needed for WMI.
> >> >> Try turning off the FW on one of the remote machines - and if it
> >> >> works -
> >> >> you
> >> >> will need to make exceptions in the firewall.
>
> >> >> CreateWindow
> >> >>http://mymessagetaker.com
> >> >> Stop using those paper phone message pads
> >> >> make the computer work for you.
> >> >>http://justpageprobe.com
> >> >> The FREE Web page utility you always wanted.
> >> >> Monitor your enterprise Web Servers.
> >> >> Keep your router connected.
> >> >> Email your IP to where you need it.
>
> >> >> "Saitor" <Sai...[ at ]discussions.microsoft.com> wrote in message
> >> >>news:714D58FD-3227-4956-A9FF-40E36594890B[ at ]microsoft.com...
> >> >> > Hi all,
>
> >> >> > On every week we must provide free space hardisk information. Ihave
> >> >> > tried
> >> >> > to
> >> >> > run this script :
>
> >> >> > ------------
> >> >> > Option Explicit
>
> >> >> > Const HARD_DISK = 3
> >> >> > Dim arrArgs, strComputer, objWMIService, colDisks, objDisk,
> >> >> > lngFreeSpace
>
> >> >> > Set arrArgs = WScript.Arguments
> >> >> > If arrArgs.Count = 1 Then
> >> >> > strComputer = arrArgs(0)
> >> >> > Else
> >> >> > strComputer = InputBox("Enter the Computer Name to check Free HD
> >> >> > Space:",
> >> >> > "Computer Name", strComputer)
> >> >> > End If
>
> >> >> > Set objWMIService = GetObject("winmgmts:" _
> >> >> > & "{impersonationLevel=impersonate}!\\" & strComputer &
> >> >> > "\root\cimv2")
>
> >> >> > Set colDisks = objWMIService.ExecQuery _
> >> >> > ("Select * from Win32_LogicalDisk Where DriveType = " & HARD_DISK
> >> >> > &
> >> >> > "")
>
> >> >> > For Each objDisk In colDisks
> >> >> > lngFreeSpace = objDisk.FreeSpace/(1024*1024) ''divide into MB
> >> >> > Wscript.Echo "Computer Name: " & strComputer & vbCrLf & _
> >> >> > "Drive Letter: "& vbTab & objDisk.DeviceID & vbCrLf & _
> >> >> > "Free Disk Space: "& vbTab & Round(lngFreeSpace) & " MBs"
> >> >> > Next
> >> >> > --------------
>
> >> >> > But everytime I type IP or Computer Name for the server which we
> >> >> > want
> >> >> > view,
> >> >> > there is message permission dened:'Get Object".
> >> >> > And this is not happen if we put the local server.
>
> >> >> > What scripts that must I have to added for view free space on remote
> >> >> > PC.
> >> >> > many thanks for your kindness.- Hide quoted text -
>
> - Show quoted text -

You May also try and edit the WMI NameSpace Security for Cimv2 and
access it.
Use wmimgmt.msc for the same refer to the following

http://msdn2.microsoft.com/en-us/library/aa393266.aspx

Related article section would also be helpfull in this case


Thanks
addy

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen