/******************************************************************************
Help Desk Demo Script by
FastTrack Software
This script may be used for any purpose without permission from the author
******************************************************************************/
/****************
ELEVATE FROM UAC *****************/
ElevateUser
/*********************************
SHOW MENU **********************************/
:Restart
SetVar Selection,[Menu
Help Desk Application,Shield|Create User,Trashcan|Delete
User,Lock|Disable User,Config|Enable User,_
Connected|Change User
Password,Network|Unlock User Account,Defrag|Move User,Tools|Show User Groups,_
Download|Show Group
Members,NetworkFolder|Add User To Group,ControlPanel|Remove User From Group]
If Not
[Var Selection]=[Blank]
Then Goto [Var Selection]
Exit
/*******************
CREATE USER ACCOUNT IN A SELECTABLE OU *******************/
:Create User
MultiInput New
User,UserName|User name (Initials),First name,Last name,Password
If Not
[Var UserName]=[Blank]
Then
SetVar SelectedOU,[ListMenu
Select location,Root,[AllOUs]]
If Not [Var
SelectedOU]=[Blank]
Then
If Ask "Are
you sure you wish to create the user [Var UserName] in
the location [Var SelectedOU]?"
Then
If [Var SelectedOU]=Root
Then
CreateUserPlain [Var
UserName],[Var
Password]
Else
CreateUserPlain [Var
UserName],[Var
Password],[Var
SelectedOU]
End If
SetUserName [Var UserName],[Var
First name],[Var
Last name]
ShowMessage "User
[UserFullName [Var UserName]] is
now created and ready to logon"
End If
End If
End If
Goto Restart
/****************************
DELETE USER ACCOUNT *****************************/
:Delete User
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
If Ask "Are
you SURE you wish to DELETE the user [Var SelectedUser]?"
Then
DeleteUser [Var SelectedUser]
ShowMessage "User
[Var SelectedUser] is
now deleted and can no longer log on to the network"
End If
End If
Goto Restart
/****************************
DISABLE USER ACCOUNT ****************************/
:Disable User
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
If Ask "Are
you sure you wish to disable the user [Var SelectedUser]?"
Then
DisableUser [Var SelectedUser]
ShowMessage "User
[Var SelectedUser] is
now disabled and can no longer log on"
End If
End If
Goto Restart
/****************************
ENABLE USER ACCOUNT *****************************/
:Enable User
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
If Ask "Are
you sure you wish to enable the user [Var SelectedUser]?"
Then
EnableUser [Var SelectedUser]
ShowMessage "User
[Var SelectedUser] is
now enabled"
End If
End If
Goto Restart
/****************************
UNLOCK USER ACCOUNT *****************************/
:Unlock User
Account
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
If Ask "Are
you sure you wish to unlock the user [Var SelectedUser]?"
Then
UnlockUser [Var SelectedUser]
ShowMessage "User
account [Var SelectedUser] is
now unlocked"
End If
End If
Goto Restart
/****************************
CHANGE USER PASSWORD ****************************/
:Change User
Password
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
SetVar Password,[InputPassword
Enter new password]
If Ask "Are
you sure you wish to change the password for user [Var SelectedUser]?"
Then
SetUserPasswordPlain [Var
SelectedUser],[Var
Password]
UnlockUser [Var
SelectedUser]
''Just in case the user has tried with bad passwords
ShowMessage "The
user [Var SelectedUser] can
now log on with the new password"
End If
End If
Goto Restart
/*****************************
MOVE USER ACCOUNT *****************************/
:Move User
SetVar SelectedUser,[ListMenu
Select user,[AllUsers]]
If Not
[Var SelectedUser]=[Blank]
Then
SetVar SelectedOU,[ListMenu
Select new location,[AllOUs]]
If Ask "Are
you sure you wish to move the user [Var SelectedUser] to
[Var SelectedOU]?"
Then
MoveUser [Var SelectedUser],[Var
SelectedOU]
ShowMessage "User
[Var SelectedUser] is
now moved to location [Var SelectedOU]"
End If
End If
Goto Restart
/*****************************
SHOW USER'S GROUPS *****************************/
:Show User
Groups
SetVar SelectedUser,[ListMenuForced
Select user,[AllUsers]]
SetVar SelectedGroup,[ListMenu
User [Var SelectedUser] is
member of:,[UserGroups [Var SelectedUser]]]
Goto Restart
/*****************************
SHOW GROUP MEMBERS *****************************/
:Show Group
Members
SetVar SelectedGroup,[ListMenuForced
Select a group,[AllGroups]]
SetVar SelectedMember,[ListMenu
Members of [Var SelectedGroup],[GroupUsers
[Var SelectedGroup]]]
Goto Restart
/*****************************
ADD USER TO GROUP ******************************/
:Add User To
Group
SetVar SelectedGroup,[ListMenu
Select a group,[AllGroups]]
If Not
[Var SelectedGroup]=[Blank]
Then
If [IndexOf [Var SelectedGroup],Admin]>0
Then
ShowMessage "You
cannot add users to any administrator group!"
Else
SetVar SelectedUser,[ListMenu
Select a user to add,[AllUsers]]
If Not [Var
SelectedUser]=[Blank]
Then
If Ask "Are
you sure you wish to add [UserFullName [Var SelectedUser]] to
the group [Var SelectedGroup]?"
Then
AddUserToGroup [Var SelectedUser],[Var
SelectedGroup]
ShowMessage
"User [UserFullName
[Var SelectedUser]] is now
a member of the group [Var SelectedGroup]"
End If
End If
End If
End If
Goto Restart
/***************************
REMOVE USER FROM GROUP ***************************/
:Remove User
From Group
SetVar SelectedGroup,[ListMenu
Select a group,[AllGroups]]
If Not
[Var SelectedGroup]=[Blank]
Then
If [IndexOf [Var SelectedGroup],Admin]>0 Then
ShowMessage "You
cannot remove users from any administrator group!"
Else
SetVar SelectedUser,[ListMenu
Select a user to remove,[GroupUsers [Var SelectedGroup]]]
If Not [Var
SelectedUser]=[Blank]
Then
If Ask "Are
you sure you wish to remove [UserFullName [Var SelectedUser]] from
the group [Var SelectedGroup]?"
Then
RemoveUserFromGroup [Var
SelectedUser],[Var
SelectedGroup]
ShowMessage "User
[UserFullName [Var SelectedUser]] is
no longer member of the group [Var SelectedGroup]"
End If
End If
End If
End If
Goto Restart