From: Pegasus [MVP] on 31 Dec 2009 10:50 When you examine and run the script then you will see several things: a) The script will inspect *all* drive letters. b) The property oDrive.Path shows the drive letter (e.g. D:) c) The property oDrive.AvailableSpace shows the amount of free space. You now need to compare oDrive.AvailableSpace against whatever limit you wish to set, then invoke the EMail module if your free space drops below the set limit. "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item news:#9fXH8iiKHA.5524(a)TK2MSFTNGP06.phx.gbl... > I do not understand is as if it detects that there is little space to run > the email sending. > If a server has multiple disks, it detects all?. > > "Pegasus [MVP]" <news(a)microsoft.com> wrote in message > news:OJ4oH5iiKHA.1236(a)TK2MSFTNGP04.phx.gbl... >> >> >> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >> news:86144BCB-29F3-43B4-AF6A-081C68F0E83B(a)microsoft.com... >>> I can not implement all the code! >> >> The idea is for you to grab the parts that are relevant for you. Feel >> free to ask if certain details are unclear. >> >> >> >
From: MiguelA on 31 Dec 2009 10:57 I will try and tell you something "Pegasus [MVP]" <news(a)microsoft.com> wrote in message news:e4ixPEjiKHA.5568(a)TK2MSFTNGP02.phx.gbl... > When you examine and run the script then you will see several things: > a) The script will inspect *all* drive letters. > b) The property oDrive.Path shows the drive letter (e.g. D:) > c) The property oDrive.AvailableSpace shows the amount of free space. > > You now need to compare oDrive.AvailableSpace against whatever limit you > wish to set, then invoke the EMail module if your free space drops below > the set limit. > > > "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item > news:#9fXH8iiKHA.5524(a)TK2MSFTNGP06.phx.gbl... >> I do not understand is as if it detects that there is little space to run >> the email sending. >> If a server has multiple disks, it detects all?. >> >> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >> news:OJ4oH5iiKHA.1236(a)TK2MSFTNGP04.phx.gbl... >>> >>> >>> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >>> news:86144BCB-29F3-43B4-AF6A-081C68F0E83B(a)microsoft.com... >>>> I can not implement all the code! >>> >>> The idea is for you to grab the parts that are relevant for you. Feel >>> free to ask if certain details are unclear. >>> >>> >>> >>
From: MiguelA on 8 Jan 2010 03:27 I have this, but as email command?? Option Explicit Dim strComputer, objWMIService, colMonitoredDisks, objDiskChange Dim i, strMessage Const LOCAL_HARD_DISK = 3 strComputer = "West204" Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & strComputer & "\root\cimv2") Set colMonitoredDisks = objWMIService.ExecNotificationQuery ("SELECT * FROM __instancemodificationevent WITHIN 30 WHERE " & "TargetInstance ISA 'Win32_LogicalDisk'") i = 0 Do While i = 0 Set objDiskChange = colMonitoredDisks.NextEvent If objDiskChange.TargetInstance.DriveType = LOCAL_HARD_DISK Then If objDiskChange.TargetInstance.Size < 100000000 Then strMessage = "Hard disk " & objDiskChange.TargetInstance.Name & " on computer " & strComputer & " is below 100,000,000 bytes." End If End If Loop "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> wrote in message news:eJ$ivHjiKHA.5248(a)TK2MSFTNGP04.phx.gbl... >I will try and tell you something > > "Pegasus [MVP]" <news(a)microsoft.com> wrote in message > news:e4ixPEjiKHA.5568(a)TK2MSFTNGP02.phx.gbl... >> When you examine and run the script then you will see several things: >> a) The script will inspect *all* drive letters. >> b) The property oDrive.Path shows the drive letter (e.g. D:) >> c) The property oDrive.AvailableSpace shows the amount of free space. >> >> You now need to compare oDrive.AvailableSpace against whatever limit you >> wish to set, then invoke the EMail module if your free space drops below >> the set limit. >> >> >> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >> news:#9fXH8iiKHA.5524(a)TK2MSFTNGP06.phx.gbl... >>> I do not understand is as if it detects that there is little space to >>> run the email sending. >>> If a server has multiple disks, it detects all?. >>> >>> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >>> news:OJ4oH5iiKHA.1236(a)TK2MSFTNGP04.phx.gbl... >>>> >>>> >>>> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >>>> news:86144BCB-29F3-43B4-AF6A-081C68F0E83B(a)microsoft.com... >>>>> I can not implement all the code! >>>> >>>> The idea is for you to grab the parts that are relevant for you. Feel >>>> free to ask if certain details are unclear. >>>> >>>> >>>> >>> >
From: Pegasus [MVP] on 8 Jan 2010 04:52 I gave you an EMail function in my reply of two weeks ago. Did you use the function? If something is not clear then please say exactly what it is. Note also that while WMI is a wonderful thing, it can place a heavy load on the CPU. I recommend that you check your CPU loading before finalising this project. "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item news:E4204C0F-B9A5-4911-AFCD-0C3BD13AFA8C(a)microsoft.com... > I have this, but as email command?? > > Option Explicit > > Dim strComputer, objWMIService, colMonitoredDisks, objDiskChange > Dim i, strMessage > Const LOCAL_HARD_DISK = 3 > > strComputer = "West204" > Set objWMIService = GetObject("winmgmts:" & > "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & > strComputer & "\root\cimv2") > Set colMonitoredDisks = objWMIService.ExecNotificationQuery ("SELECT * > FROM __instancemodificationevent WITHIN 30 WHERE " & "TargetInstance ISA > 'Win32_LogicalDisk'") > i = 0 > Do While i = 0 > Set objDiskChange = colMonitoredDisks.NextEvent > If objDiskChange.TargetInstance.DriveType = LOCAL_HARD_DISK Then > If objDiskChange.TargetInstance.Size < 100000000 Then > strMessage = "Hard disk " & objDiskChange.TargetInstance.Name > & " on computer " & strComputer & " is below 100,000,000 bytes." > End If > End If > Loop > > "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> wrote in message > news:eJ$ivHjiKHA.5248(a)TK2MSFTNGP04.phx.gbl... >>I will try and tell you something >> >> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >> news:e4ixPEjiKHA.5568(a)TK2MSFTNGP02.phx.gbl... >>> When you examine and run the script then you will see several things: >>> a) The script will inspect *all* drive letters. >>> b) The property oDrive.Path shows the drive letter (e.g. D:) >>> c) The property oDrive.AvailableSpace shows the amount of free space. >>> >>> You now need to compare oDrive.AvailableSpace against whatever limit you >>> wish to set, then invoke the EMail module if your free space drops below >>> the set limit. >>> >>> >>> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >>> news:#9fXH8iiKHA.5524(a)TK2MSFTNGP06.phx.gbl... >>>> I do not understand is as if it detects that there is little space to >>>> run the email sending. >>>> If a server has multiple disks, it detects all?. >>>> >>>> "Pegasus [MVP]" <news(a)microsoft.com> wrote in message >>>> news:OJ4oH5iiKHA.1236(a)TK2MSFTNGP04.phx.gbl... >>>>> >>>>> >>>>> "MiguelA" <ma.camaleon(a)NOSPAMgmail.com> said this in news item >>>>> news:86144BCB-29F3-43B4-AF6A-081C68F0E83B(a)microsoft.com... >>>>>> I can not implement all the code! >>>>> >>>>> The idea is for you to grab the parts that are relevant for you. Feel >>>>> free to ask if certain details are unclear. >>>>> >>>>> >>>>> >>>> >> >
From: Eric on 12 Jan 2010 10:11 On Jan 8, 4:52 am, "Pegasus [MVP]" <n...(a)microsoft.com> wrote: > I gave you an EMail function in my reply of two weeks ago. Did you use the > function? If something is not clear then please say exactly what it is. > > Note also that while WMI is a wonderful thing, it can place a heavy load on > the CPU. I recommend that you check your CPU loading before finalising this > project. > > "MiguelA" <ma.camal...(a)NOSPAMgmail.com> said this in news itemnews:E4204C0F-B9A5-4911-AFCD-0C3BD13AFA8C(a)microsoft.com... > > > > > I have this, but as email command?? > > > Option Explicit > > > Dim strComputer, objWMIService, colMonitoredDisks, objDiskChange > > Dim i, strMessage > > Const LOCAL_HARD_DISK = 3 > > > strComputer = "West204" > > Set objWMIService = GetObject("winmgmts:" & > > "{impersonationLevel=impersonate,authenticationLevel=Pkt}!\\" & > > strComputer & "\root\cimv2") > > Set colMonitoredDisks = objWMIService.ExecNotificationQuery ("SELECT * > > FROM __instancemodificationevent WITHIN 30 WHERE " & "TargetInstance ISA > > 'Win32_LogicalDisk'") > > i = 0 > > Do While i = 0 > > Set objDiskChange = colMonitoredDisks.NextEvent > > If objDiskChange.TargetInstance.DriveType = LOCAL_HARD_DISK Then > > If objDiskChange.TargetInstance.Size < 100000000 Then > > strMessage = "Hard disk " & objDiskChange.TargetInstance.Name > > & " on computer " & strComputer & " is below 100,000,000 bytes." > > End If > > End If > > Loop > > > "MiguelA" <ma.camal...(a)NOSPAMgmail.com> wrote in message > >news:eJ$ivHjiKHA.5248(a)TK2MSFTNGP04.phx.gbl... > >>I will try and tell you something > > >> "Pegasus [MVP]" <n...(a)microsoft.com> wrote in message > >>news:e4ixPEjiKHA.5568(a)TK2MSFTNGP02.phx.gbl... > >>> When you examine and run the script then you will see several things: > >>> a) The script will inspect *all* drive letters. > >>> b) The property oDrive.Path shows the drive letter (e.g. D:) > >>> c) The property oDrive.AvailableSpace shows the amount of free space. > > >>> You now need to compare oDrive.AvailableSpace against whatever limit you > >>> wish to set, then invoke the EMail module if your free space drops below > >>> the set limit. > > >>> "MiguelA" <ma.camal...(a)NOSPAMgmail.com> said this in news item > >>>news:#9fXH8iiKHA.5524(a)TK2MSFTNGP06.phx.gbl... > >>>> I do not understand is as if it detects that there is little space to > >>>> run the email sending. > >>>> If a server has multiple disks, it detects all?. > > >>>> "Pegasus [MVP]" <n...(a)microsoft.com> wrote in message > >>>>news:OJ4oH5iiKHA.1236(a)TK2MSFTNGP04.phx.gbl... > > >>>>> "MiguelA" <ma.camal...(a)NOSPAMgmail.com> said this in news item > >>>>>news:86144BCB-29F3-43B4-AF6A-081C68F0E83B(a)microsoft.com... > >>>>>> I can not implement all the code! > > >>>>> The idea is for you to grab the parts that are relevant for you. Feel > >>>>> free to ask if certain details are unclear.- Hide quoted text - > > - Show quoted text - Am I correct that your script in this thread is designed to run locally on the server? Is there a way to write a script that can get drive and directory size information for a server, running on a client pc with network admin credentials? From what I can find on the FSO, it only works on the local pc or mapped drives. I have a working script which connects to the servers and gets drive space info from Win32_DiskDrive. Now I want more details, to show which folders are using the most space, without having the folders marked as shared. This would seem simple if I ran it locally on the server but I want to be able to run it from my client pc and I want it to connect to get info from multiple servers.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 Prev: Trying to run a non-Win32 Application Next: Rename files based on file name? |