[THIN] Re: message notifier

  • From: "Jon Spriggs" <jon.spriggs@xxxxxxxxx>
  • To: thin@xxxxxxxxxxxxx
  • Date: Tue, 28 Mar 2006 14:33:41 +0100

How about netsending the whole domain?

Regards,

Jon

On 3/28/06, IT Support <it@xxxxxxxxxxxx> wrote:
>
>
>
> Greetings list
>
>
>
> We currently employ a VBS script to notify users about mundane stuff like
> Server Reboots and sandwich rounds (see below) but have noticed that this
> can spike CPU and memory usage with the trillions of net sends that the
> script sends out….
>
>
>
> Has anyone else found a more efficient way to net send users?
>
>
>
> Please feel free to tear apart the script and pick holes =)
>
>
>
> -------------------------- Script Below ----------------------------
>
> sGroupName = "All Internal Users"
>
> sDomain = "CORPORATE DOMAIN NAME"
>
> sMessage = "Server will be rebooted in 5 mins, please save your work and log
> out"
>
> bForce = False
>
> On Error Resume Next
>
> Err.Clear
>
> Set oGroup = GetObject("WinNT://" & sDomain _
>
>   & "/" & sGroupName & ",group")
>
> If Err.Number <> 0 Then
>
>   Err.Clear
>
>   Wscript.Echo "Unable to find group " & sGroupName
>
>   Wscript.Quit(1)
>
> End If
>
> On Error GoTo 0
>
> Set oShell = CreateObject("Wscript.Shell")
>
> nCount = 0
>
> nError = 0
>
> For Each oMember In oGroup.Members
>
>   nRC = oShell.Run("command /c net send "& oMember.Name & " " & sMessage, 0,
> bForce)
>
>   If nRC = 0 Then
>
>     nCount = nCount + 1
>
>   Else
>
>     nError = nError + 1
>
>     Wscript.Echo "Message NOT sent to " & oMember.Name _
>
>       & ", error code " & nRC
>
>   End If
>
> Next
>
> --------------------------------------------------------------------------
>
>
>
> Regards,
>
> Jaime
>
>
************************************************
For Archives, RSS, to Unsubscribe, Subscribe or
set Digest or Vacation mode use the below link:
//www.freelists.org/list/thin
************************************************

Other related posts: