EgilHansen
IS-IT--Management
- Jan 3, 2006
- 16
Hello
I'm trying to seperate the rules in my logon script from the logon script, and put them in a xml file. I've created the xml+dtd, but I've been having a very hard time trying to get the vbscript code to work.
Here's what I basicly want to do, in sudo code:
If somebody would be kind enough to help me out with this I would be gratefull.
Best regards, Egil.
The xml+dtd code:
I'm trying to seperate the rules in my logon script from the logon script, and put them in a xml file. I've created the xml+dtd, but I've been having a very hard time trying to get the vbscript code to work.
Here's what I basicly want to do, in sudo code:
Code:
For Each group in groups
If UserInGroup(group.groupname) Then
For Each mapnetworkdrive in actions
Call Mapnetworkdrive (mapnetworkdrive.drive, mapnetworkdrive.server,
mapnetworkdrive.share)
Next
'... and so on with the other actions
End If
Next
If somebody would be kind enough to help me out with this I would be gratefull.
Best regards, Egil.
The xml+dtd code:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE logonactions[
<!ELEMENT logonactions (groups?,users?,computers?)>
<!ELEMENT runprogram (program,message)>
<!ELEMENT mapnetworkdrive (drive,server,share)>
<!ELEMENT addprinter (domain,server,printer)>
<!ELEMENT setdefaultprinter (#PCDATA)>
<!ELEMENT program (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT drive (#PCDATA)>
<!ELEMENT server (#PCDATA)>
<!ELEMENT share (#PCDATA)>
<!ELEMENT domain (#PCDATA)>
<!ELEMENT printer (#PCDATA)>
<!ELEMENT actions
(mapnetworkdrive*,addprinter*,setdefaultprinter?,runprogram*)>
<!ELEMENT groups (group*)>
<!ELEMENT group (groupname,actions)>
<!ELEMENT groupname (#PCDATA)>
<!ELEMENT users (user*)>
<!ELEMENT user (username,actions)>
<!ELEMENT username (#PCDATA)>
<!ELEMENT computers (computer*)>
<!ELEMENT computer (computername,actions)>
<!ELEMENT computername (#PCDATA)>
]>
<logonactions>
<groups>
<group>
<groupname>standard</groupname>
<actions>
<mapnetworkdrive>
<drive>G</drive>
<server>srv999b</server>
<share>NETAPPL</share>
</mapnetworkdrive>
<mapnetworkdrive>
<drive>R</drive>
<server>srv100p</server>
<share>file_exchange$</share>
</mapnetworkdrive>
<runprogram>
<program>program.exe</program>
<message>Running program.exe client</message>
</runprogram>
</actions>
</group>
</groups>
</logonactions>