Page 1 of 1 1
Topic Options
#58572 - 2001-08-25 09:45 AM KIX32 to check for logins & holidays!
Anonymous
Unregistered


Excuse the crudeness of the script.. but I wanted to share this..

Wot does it do??.. hehehe It checks for a user logged onto another machine within a 40min period... also checks to see if they are spose to be on hollies!!

the hollies file should be updated every week from your local HR dept as leave is approved there... this script checks for names and dates and of course if their name is there and the current date is less than their hollies.. then alarm bells!!!


$USERIDTST = "Dave.walters"
$IDCOMP = "DAVES"
$USERID = readprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","USER NAME")
$machinename = readprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","Computer Name")
$DATE = readprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","Date")

$HOLLIEDATE = readprofilestring ("c:\dsc\DSCHOL.ini","$USERIDTST","finishdate")
$HOLLIEID = readprofilestring ("c:\dsc\DSCHOL.ini","$USERIDTST","USER NAME")

IF $USERIDTST = $HOLLIEID
IF $HOLLIEDATE > @DATE
?"Spose to be on hollies!!"
goto endit
endif
endif

IF $USERIDTST <> $USERID
?"no profile exists"
gosub update
goto endit
endif

IF $IDCOMP = $MACHINENAME AND $USERIDTST = $USERID
?"no worries!"
gosub update
else
IF $DATE <> @DATE
gosub update
else
?"CHECK THE TIMES"
?""
; some test vars, these are in the same format as @time
$start=readprofilestring ("c:\dsc\DSCSYS.ini","MISC","time")
$end=@TIME
; convert times to seconds.
$startsecs=val(substr($start, 1, 2))*3600 + val(substr($start, 4, 2))*60 + val(substr($start, 7, 2))
$endsecs=val(substr($end, 1, 2))*3600 + val(substr($end, 4, 2))*60 + val(substr($end, 7, 2))
; subtract start from end
$diffsecs=$endsecs-$startsecs
; convert difference to HH:MM:SS
$hours=$diffsecs/3600
$minutes=($diffsecs-($hours*3600))/60
$seconds=($diffsecs-($hours*3600)-($minutes*60))
; convert the numbers to strings and add leading zeros if required
if $hours<10 $hours="0$hours" else $hours="$hours" endif
if $minutes<10 $minutes="0$minutes" else $minutes="$minutes" endif
if $seconds<10 $seconds="0$seconds" else $seconds="$seconds" endif
; create string
$diff=$hours+":"+$minutes+":"+$seconds
$diff ?

if $DIFF > 00:40:00
?"shes rite!"
gosub update
else
?"ASK 'em"
endif
endif
endif

goto endit

:UPDATE
?"Update"
$NUL = Writeprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","USER NAME","$USERIDTST")
$NUL = Writeprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","Computer Name","@WKSTA")
$NUL = Writeprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","time","@TIME")
$NUL = Writeprofilestring ("c:\dsc\DSCSYS.ini","$USERIDTST","date","@DATE")
return

:endit

Top
#58573 - 2001-08-26 11:04 AM Re: KIX32 to check for logins & holidays!
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Bonky,

You guys must have a real fun place to work if you need to write a script to check and make sure someone is on vacation when there supposed to be.

We can't get people to always show up

Nice script idea though...

Top
#58574 - 2001-08-27 12:04 AM Re: KIX32 to check for logins & holidays!
Anonymous
Unregistered


its not that much of a problem! <smile> just some users like to use other users passwords while away... its hard to keep track of.. this way... I can let the script do it!
Top
#58575 - 2001-08-26 05:08 PM Re: KIX32 to check for logins & holidays!
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Bonky,
On my LAN, we have a sure cure for people that don't secure their passwords and workstations. We use internet 'tattler' software that generates a report of usage for HR and the managers. Around our site, if someone finds an unsecured WS, they use it to surf porn. Well, the smart ones do, the dumb one use their own.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#58576 - 2001-10-15 06:43 AM Re: KIX32 to check for logins & holidays!
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Again interesting item.

Our point of view is:

For some organisations it is possible that HR knows when people are gone.
Also it is possible that a department organize it.
So a lot of information about holidays can be very decentralized within
the organization.

Mostly users activate the Out of Office options in their email system.
So by getting those information from your mail server you know exactly:
which person aren't present and which person should be present.
But is this interesting?

Absolutly NOT.

An user account is personal. Possible mail must be forward automatically to
another person or your are using department/group mailing lists.
A policy within our organization is that the department organizes work in such
a way that there will be never a situation that people only can look out of
their window because a person is away.

For special tasks we have introduce functional user-accounts: no related to
a person and only with the required functionalities for those tasks. Mostly
to prevent an enormous amount of problems by moving users capabilities to
another and to prevent that tasks can't be done because the configurations
and authorizations aren't right.
Such special accounts we are monitoring for unexpected things.


Of course it can be possible in some situations, that an account must be
entered by another person. In those cases our organization uses a form, which
must be signed by persons with the power to it. Form contains username, reason
and period.
After verification of that form the network-administrator will change the password
and after specified period the account will be blocked.
By policy documents users know the rules.

btw: in an organization 'accounts payable' also only possible by a small group of persons.

btw: by surfing to unwanted sites on the internet people know they can be fired.
question: why should you risk your job, when internet is in many countries for
free or nearly free of charges?

Greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.055 seconds in which 0.027 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org