Re: Script which is running very slowly...

Tech-Archive recommends: Fix windows errors by optimizing your registry



Did you ever try TreeSize (http://www.jam-software.com).
You can run it from a command-line, batchfile or script.

On Thu, 31 Mar 2005 06:07:06 -0800, "Morten_Leth"
<Morten_Leth@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Hey everyone
>
>I have a little problem with my script which..
>I have been assigned a task, to make a script which enumerate how much a
>user uses of diskspace...
>
>I know why it runs slowly, first... I Use Winnt (don't know how to use LDAP
>to do it) and then i run the script for every group in the domain, and then
>again for every user in the groups... (again, i can't see how i can do
>anything about it.)
>
>my next problem is that i can't get the script to write 0,00 if the value is
>0, this is probably because i use Round()
>
>Here's the script....
>
>
>option explicit
>
>dim strDomain, objDomain, network, objGroup, strStartGroup, strNumber, _
>objUser, strMB, FSO, objFSO, strFolderSize, strUserGroup, strTotal
>
>Set Network = Wscript.CreateObject("Wscript.Network")
>StrDomain = Network.UserDomain
>Set fso = CreateObject("Scripting.FileSystemObject")
>
>Set objDomain = GetObject("WinNT://" & StrDomain)
>objDomain.Filter = Array("group")
>For Each objGroup In objDomain
>if Len(objGroup.Name) = 13 then
>strStartGroup = ucase(left(objGroup.Name, 10))
>strNumber = mid(objGroup.Name, 11)
> if strStartGroup = "GGMAG4AZKS" then
>on error resume next
> if strNumber = 0 then
>
> else
> for each objUser in objGroup.members
> Set objFSO = fso.GetFolder("\\mag4azkssc1fil2\brugerdata$\" &
>objUser.Name)
> strMB = objFSO.size /1048576
> strFolderSize = "\\mag4azkssc1fil2\brugerdata$\" & objFSO.Name & " ;
>" & Round(strMB, 2) & vbCrLf & strFolderSize
> if strMB = 0 then
> strMB = "0,00"
> else
>
> end if
> strTotal = Round(strMB, 2) + strTotal
>
> next
> strUserGroup = objGroup.Name & "- " & objGroup.Description & vbCrLf &
>"------------------- " & vbCrLf & strFolderSize & vbCrLf & "Total = " &
>Round(strTotal, 2)
> wscript.echo strUserGroup
> strTotal = 0
> end if
>err.clear
>on error goto 0
> else
>
> end if
>else
>
>end if
>Next
>wscript.echo strUserGroup
>
>Hope anyone can help....
>
>/Leth

.



Relevant Pages

  • RE: export user accounts from NT 4.0 domain
    ... ATTENTION THE SCRIPT MUST BE RUNNED FROM A COMPUTER WHERE EXCEL IS ... from the information in a Microsoft Excel spreadsheet. ... Dim strLast, strFirst, strMiddle, strPW, intRow, intCol ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • Re: unable to bind to group (adding users to dist. group en masse)
    ... Will the script below read users in from a text file? ... Dim strNTName, objUser, strNetBIOSDomain, intCount ... On Error GoTo 0 ... Dim proxyaddresses, proxyaddress ...
    (microsoft.public.windows.server.active_directory)
  • Re: Group Policy Timeout on one server in an OU.
    ... inheritance of that login script and placed myself in the OU. ... On Error GoTo 0 ... Group Policy Management solutions athttp://www.sdmsoftware.com ...
    (microsoft.public.windows.group_policy)
  • Re: Active Directory Inventory Script
    ... I am now trying to amend the script to only take the first 3 ... Dim strExcelPath, objExcel, objSheet, intRow ... ' Spreadsheet file name to be created. ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)
  • Re: Active Directory Inventory Script
    ... I am now trying to amend the script to only take the first 3 ... Dim strExcelPath, objExcel, objSheet, intRow ... ' Spreadsheet file name to be created. ... On Error GoTo 0 ...
    (microsoft.public.windows.server.scripting)