#190231 - 2008-10-21 10:31 PM
Re: Hi, All - (Where do i Post a Full Script I want to Share)
[Re: Glenn Barnas]
|
Indigo
Fresh Scripter

Registered: 2008-10-01
Posts: 34
|
In the example below when I am setting up the variables to be passed do I have to demention the variables again if the Var names are the same as previously Dim'ed Variables.
For Example $EmailServer, or $IT_Email
Function SendEmail($User,$system,$systemup,$EmailServer,$IT_Email,$EmailSufix,$RS_Logs,$Userstoskip)
; == Declaring Variables
Dim $User ; User to be emailed
Dim $System ; Hostname of current system
Dim $Systemup ; Uptime of Current system
Dim $Unli ; Defined as (User Not Logged In) - Incase user isn't logged in
;Dim $EmailSufix ; Global and needs to be passed.
;Dim $IT_Email ; is Global and needs to be passed.
;Dim $RS_log ; is Global and needs to be passed.
If len(ltrim($User)) <> 0 ; == This checks to make sure that a 0 digit value didn't show up for $User
If checkusers($User,$Userstoskip) = -1
;Shell 'bmail -s $EmailServer -t $User@@$EmailSufix -f $IT_Email -a "(System Reboot Needed!) Uptime: $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
Else
;Shell 'bmail -s $EmailServer -t $IT_Email -f $IT_Email -a "$system - $user Uptime: $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
;Shell '%compsec% net send \\$system "Alert Notice: This system has been turned on for $systemup days please reboot!, Thanks IT"'
Endif
Else
$Unli = "(User Not Logged In)"
Shell 'bmail -s $EmailServer -t $IT_Email -f $IT_Email -a "$system - $Unli System Reboot Needed! It Has been Turned on for $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
;Shell '%compsec% net send \\$system "Alert Notice: This system has been turned on for $systemup days please reboot!, Thanks IT"'
Endif
EndFunction
Also When I call a second Function inside of the first one like below for Checkusers do I have to pass the $Userstoskip Variable to the Function SendEmail First and then to the Function checkusers for it to pass the information along or can I just call checkusers with he added $Userstoskip variable and it will work fine.
If checkusers($User,$Userstoskip) = -1
;Shell 'bmail -s $EmailServer -t $User@@$EmailSufix -f $IT_Email -a "(System Reboot Needed!) Uptime: $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
Else
;Shell 'bmail -s $EmailServer -t $IT_Email -f $IT_Email -a "$system - $user Uptime: $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
;Shell '%compsec% net send \\$system "Alert Notice: This system has been turned on for $systemup days please reboot!, Thanks IT"'
Endif
Else
$Unli = "(User Not Logged In)"
Shell 'bmail -s $EmailServer -t $IT_Email -f $IT_Email -a "$system - $Unli System Reboot Needed! It Has been Turned on for $systemup Days." -m $RS_Logs\$system.SentEmail.txt'
;Shell '%compsec% net send \\$system "Alert Notice: This system has been turned on for $systemup days please reboot!, Thanks IT"'
Endif
Thanks!
Indigo
Edited by Indigo (2008-10-21 10:33 PM)
|
|
Top
|
|
|
|
Client Reboot Script / Sends out Email warnings) Version .6
|
Indigo
|
2008-10-20 06:44 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-20 07:21 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Lonkero
|
2008-10-20 09:04 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-20 09:08 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-20 09:15 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Lonkero
|
2008-10-20 09:19 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-20 09:21 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 01:39 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 02:12 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
NTDOC
|
2008-10-21 02:38 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 04:12 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-21 03:55 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 04:02 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-21 04:46 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 05:11 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-21 08:09 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 09:03 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-21 10:31 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 10:52 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-22 05:57 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-22 08:06 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Lonkero
|
2008-10-22 09:12 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-22 09:16 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Lonkero
|
2008-10-22 09:20 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-22 09:34 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Mart
|
2008-10-23 09:16 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 03:10 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-23 03:27 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 04:47 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 04:59 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Mart
|
2008-10-23 05:01 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 05:02 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 05:07 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Allen
|
2008-10-23 05:20 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 05:41 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Kdyer
|
2008-10-23 05:45 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 06:16 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Kdyer
|
2008-10-23 06:53 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-23 08:00 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-23 09:39 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-27 04:13 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-27 04:21 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-27 04:32 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-27 04:34 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-27 04:41 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-28 08:06 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-28 08:14 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-29 04:40 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-29 04:47 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-29 04:57 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-29 05:05 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-29 05:52 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-30 04:23 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-28 08:24 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Lonkero
|
2008-10-28 10:03 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-28 10:10 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Mart
|
2008-10-27 04:25 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Gargoyle
|
2008-10-23 04:54 PM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 12:47 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Glenn Barnas
|
2008-10-21 12:53 AM
|
Re: Hi, All - (Where do i Post a Full Script I want to Share)
|
Indigo
|
2008-10-20 09:00 PM
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 566 anonymous users online.
|
|
|