Page 1 of 1 1
Topic Options
#198431 - 2010-04-22 09:16 AM message box mapped drive choice
John_Ross Offline
Just in Town

Registered: 2010-04-22
Posts: 4
Loc: Abu Dhabi, UAE
i am Having some errors in this auto map drive logon script please help



 Code:
;  KIXTART.SCR
;
;**** Last Modified on 22/04/2010 at 2:32:16 PM by JOHN ****

;*** 靈컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴
;***                                                                        
;***  Windows 2008 Server Login Scripts for Trianon Hotel, Abu Dhabi        
;***  Created by/when : IT Dept.,Trianon Hotel, Abu Dhabi / 1 Jan 2010      
;***  Updated by/when : ................                                    
;***                                                                        
;*** 聃컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴

; 靈컴컴컴컴컴컴컴캠
; 튘NITIALITIATION
; 聃컴컴컴컴컴컴컴캭

  $domsvr = "\\TrianonSERV"   ;Trianon Hotel, Abu Dhabi
  $appsvr = "\\TrianonSERV"   ;Application Server

; 靈컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴캠
;  PROCEDURE TO DISPLAY A WELCOME MESSAGE 
; 聃컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴컴캭
CLS


Small
Color c/n
Box (0,0,24,79,GRID)            ; 'background grid'
Color c+/n
Box (7,21,18,71,)              ; 'shadow of the box'
Color y/n			
Box (6,20,17,70,FULL)		; 'the box'

Color w+/n
AT ( 7,25) "Welcome to IT Dept., Have a Nice Day"
AT ( 9,25) "Full name    : "    ; display some text strings
AT (10,25) "Userid       : "
AT (11,25) "Privilege    : "
AT (12,25) "Workstation  : "
AT (13,25) "Domain       : "
AT (14,25) "Logon Server : "
AT (15,25) "Current Time : "
AT (16,25) "Current Date : "

Color y+/n
AT ( 9,43) @fullname            ; ...and some macro's
AT (10,43) @userid
AT (11,43) @priv
AT (12,43) @wksta
AT (13,43) @domain
AT (14,43) @lserver
AT (15,43) @time
AT (16,43) @date

sleep 5                         ; Wait for 5 secs (or key)

CLS

Color w+/n
AT (0,0) "Please wait....Checking for your Domain Group Memberships..."

Color b+n
Box (1,0,5,79,full)

Color w+/n

AT (2,5) "Welcome " @fullname " "
AT (4,5) "Please wait while the appropriate drives are Mapped..."
 
;Drive_Mappings

Use * /delete       
		
        
If InGroup("A&G")=1

        Use S: "\\TrianonSERV\A&G"
                 AT (16,12) "S: Drive mapped to A&G on TrianonSERV"
	Use P: "\\TrianonSERV\public drive"
	         AT (11,12) "P: Drive mapped to A&G on TrianonSERV"
        
EndIf
If InGroup("F&B")=1 

       Use S: "\\TrianonSERV\F&B"
		AT (19,12) "S: Drive mapped to F&B on TrianonSERV"
       Use P: "\\TrianonSERV\public drive"
	        AT (11,12) "P: Drive mapped to F&B on TrianonSERV"
       Use H: "\\TrianonSERV\F&B Manager"
	        AT (15,12) "P: Drive mapped to F&B Manager on TrianonSERV"

EndIf
If InGroup("ENGINEERING")=1 

       Use S: "\\TrianonSERV\Engineering"
		AT (19,12) "S: Drive mapped to ENGINEERING on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to ENGINEERING on TrianonSERV"

EndIf
If InGroup("Front Office")=1 

       Use S: "\\TrianonSERV\Front Office"
		AT (19,12) "S: Drive mapped to FRONT OFFICE on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to FRONT OFFICE on TrianonSERV"
       Use H: "\\TrianonSERV\Front Office Manager"
	        AT (15,12) "P: Drive mapped to Front Office Manager on TrianonSERV"

EndIf
If InGroup("Housekeeping")=1 

       Use S: "\\TrianonSERV\Housekeeping"
		AT (19,12) "S: Drive mapped to HOUSEKEEPING on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to HOUSEKEEPING on TrianonSERV"
       Use H: "\\TrianonSERV\Housekeeping Manager"
	        AT (15,12) "P: Drive mapped to Housekeeping Manager on TrianonSERV"

EndIf
If InGroup("HR")=1 

       Use S: "\\TrianonSERV\HR"
		AT (19,12) "S: Drive mapped to HR on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to HR on TrianonSERV"
       Use H: "\\TrianonSERV\HR Manager"
	        AT (15,12) "P: Drive mapped to HR Manager on TrianonSERV"

EndIf
If InGroup("IT")=1 

       Use S: "\\TrianonSERV\IT"
		AT (19,12) "S: Drive mapped to IT on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to IT on TrianonSERV"

EndIf
If InGroup("Reservation")=1 

       Use s: "\\TrianonSERV\Reservation"
		AT (19,12) "S: Drive mapped to Reservation on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to Reservation on TrianonSERV"
       Use H: "\\TrianonSERV\Reservation Manager"
	        AT (15,12) "H: Drive mapped to Reservation Manager on TrianonSERV"

EndIf
If InGroup("SALES")=1 

       Use S: "\\TrianonSERV\sales"
		AT (19,12) "S: Drive mapped to Sales on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to Sales on TrianonSERV"
       Use H: "\\TrianonSERV\Sales Manager"
	        AT (15,12) "H: Drive mapped to Sales Manager on TrianonSERV"

EndIf
If InGroup("Finance")=1 

       Use s: "\\TrianonSERV\Finance"
		AT (19,12) "S: Drive mapped to Finance on TrianonSERV"
       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to Finance on TrianonSERV"

EndIf
If InGroup("Administrators")=1 

       Use P: "\\TrianonSERV\Public Drive"
	        AT (11,12) "P: Drive mapped to Administrators on TrianonSERV"

KM-APS"
EndIf

sleep 5                         ; Wait for 5 secs (or key)

Exit



Edited by Mart (2010-04-22 11:44 AM)
Edit Reason: Added code tags.

Top
#198432 - 2010-04-22 11:44 AM Re: message box mapped drive choice [Re: John_Ross]
Mart Moderator Online   content
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4665
Loc: The Netherlands
Hi John,

I moved your post to a separate thread because it is not really appreciated to hijack a post from someone else.

I also added code tags around the code you posted. When posting code please enclose the code in between [ code ] your code goes here [/ code ] (remove the spaces) so the formatting is preserved and it is much more readable.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#198433 - 2010-04-22 01:04 PM Re: message box mapped drive choice [Re: John_Ross]
BradV Offline
Seasoned Scripter
****

Registered: 2006-08-16
Posts: 683
Loc: Maryland, USA
Hi John,

First, what errors are you having? Second, a few comments and questions.

1. You define $domsvr and $appsvr, but never use them.
2. In my experience users don't pay attention to login screens. So, other than saying, "Please wait," I wouldn't bother.
3. You use the same drive letters over and over. I assume a person can only be in one of these groups? If so, you'd be better off using a select statement. With the IFs, the script has to test each one. With a Select, it just tests until it finds one that matches (so put the most often hit one first, etc).
4. You don't need to put INGROUP("something")=1, just INGROUP("something") will work.
5. Add some error checking after each mapping. Write the errors to a log rather than the screen.

Let us know what errors you are seeing.

Regards,

Brad

Top
Page 1 of 1 1


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

Who's Online
0 registered and 151 anonymous users online.
Newest Members
vertage, dimi575, Drecksnacken, Nlill, webtools321
17735 Registered Users

Generated in 0.03 seconds in which 0.012 seconds were spent on a total of 13 queries. Zlib compression enabled.

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