Results 1 to 2 of 2

Thread: VBS Script in Server 2008R2

  1. #1
    Join Date
    Oct 2011
    Posts
    1

    VBS Script in Server 2008R2

    I just built a new Server 2008 R2 GC DC. I have given the server lots of roles:

    ADDS, DHCP, DNS, FS, NP&AS, Print&Doc, IIS, WDS, WSUS.

    The domain forest level is 2008R2

    The following is the ipconfig /all from the server:
    Code:
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : server1
       Primary Dns Suffix  . . . . . . . : ntechdc.ntechshop.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : ntechdc.ntechshop.com
    
    Ethernet adapter Local Area Connection:
    
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Controlle
    r
       Physical Address. . . . . . . . . : 00-1A-A0-A7-F8-AD
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::4dfa:697f:d64a:176a%11(Preferred)
       IPv4 Address. . . . . . . . . . . : 192.168.1.10(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.1.1
       DHCPv6 IAID . . . . . . . . . . . : 234887840
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-16-24-E0-44-00-1A-A0-A7-F8-AD
    
       DNS Servers . . . . . . . . . . . : ::1
                                           127.0.0.1
                                           192.168.1.10
                                           209.18.47.61
                                           209.18.47.62
       NetBIOS over Tcpip. . . . . . . . : Enabled
    
    Tunnel adapter isatap.{8DBAF0F0-FFCF-44A6-8294-F8944AE9E399}:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Microsoft ISATAP Adapter
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    
    Tunnel adapter Local Area Connection* 11:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    I have my user set in the NTechshop User Group and I am using the following VBS logon script:

    Code:
    ON ERROR RESUME NEXT
    
    Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path
    
    
    Set WSHShell = CreateObject("WScript.Shell")
    Set WSHNetwork = CreateObject("WScript.Network")
    
    'Automatically grab the user's domain name
    DomainString = Wshnetwork.UserDomain 
    
    'Find the Windows Directory
    WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
    
    'Grab the user name
    UserString = WSHNetwork.UserName
    
    'Bind to the user object to get user name and check for group memberships later
    Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
    
    'Grab the computer name for use in add-on code later
    strComputer = WSHNetwork.ComputerName
    
    
    'Now check for group memberships and map appropriate drives
    'Note that this checks Global Groups and not domain local groups.
    For Each GroupObj In UserObj.Groups
    
    'Force upper case comparison of the group names, otherwise this is case sensitive.
    Select Case UCase(GroupObj.Name)
    
    Case "NTECHSHOP"
    'Map network locations of drives
    WSHNetwork.MapNetworkDrive "P:", "\\SERVER1\NetworkShare\BACKUP PUBLIC",True
    WSHNetwork.MapNetworkDrive "M:", "\\SERVER1\NetworkShare\MICROSOFT IMAGES",True
    WSHNetwork.MapNetworkDrive "T:", "\\SERVER1\NetworkShare\REPAIR TOOLS",True
    WSHNetwork.MapNetworkDrive "N:", "\\SERVER1\NetworkShare\NTECH",True
    WSHNetwork.MapNetworkDrive "Z:", "\\SERVER1\NetworkShare\NTECH BACKUP",True
    
    
    'Map locations of network printers
    WSHNetwork.SetDefaultPrinter "\\NTECHDC\NTech WiFi Lexmark"
    
    
    
    
    End Select
    Next
    
    
    'Quit the script
    wscript.quit
    I get no errors thrown at me.

    When I logon to a workstation which is Windows 7 Ultimate joined to the domain the logon script does not run. Here is the ipconfig /all from the workstation:
    Code:
    Windows IP Configuration
    
       Host Name . . . . . . . . . . . . : NTech2-PC
       Primary Dns Suffix  . . . . . . . : ntechdc.ntechshop.com
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : ntechdc.ntechshop.com
    
    Ethernet adapter Local Area Connection:
    
       Connection-specific DNS Suffix  . : ntechdc.ntechshop.com
       Description . . . . . . . . . . . : Realtek RTL8168D/8111D Family PCI-E Gigab
    it Ethernet NIC (NDIS 6.20)
       Physical Address. . . . . . . . . : 8C-89-A5-18-CA-42
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       IPv4 Address. . . . . . . . . . . : 192.168.1.101(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Wednesday, October 19, 2011 10:16:21 AM
       Lease Expires . . . . . . . . . . : Thursday, October 27, 2011 10:16:24 AM
       Default Gateway . . . . . . . . . : 192.168.1.1
       DHCP Server . . . . . . . . . . . : 192.168.1.10
       DNS Servers . . . . . . . . . . . : 192.168.1.10
                                           209.18.47.61
                                           209.18.47.62
       Primary WINS Server . . . . . . . : 192.168.1.10
       NetBIOS over Tcpip. . . . . . . . : Enabled
    
    Tunnel adapter isatap.ntechdc.ntechshop.com:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . : ntechdc.ntechshop.com
       Description . . . . . . . . . . . : Microsoft ISATAP Adapter
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    
    Tunnel adapter Teredo Tunneling Pseudo-Interface:
    
       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :
       Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
       Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
    In the script it calls for the user to be in a global security group I believe which the group is. I have researched and found that some machines do not have a registry entry that is needed but I'm not sure that is the issue here.

    When I logon to a XP machine I get the following error thrown at me when running a gpresult:
    Code:
    Error: Invalid Namespace.
    Yet when I run gpresult RSOP in the Windows 7 Ultimate Workstation I get:

    Code:
    RSOP data for NTECHDC\chrisn on NTECH2-PC : Logging Mode
    ---------------------------------------------------------
    
    OS Configuration:            Member Workstation
    OS Version:                  6.1.7601
    Site Name:                   Default-First-Site-Name
    Roaming Profile:             N/A
    Local Profile:               C:\Users\chrisn
    Connected over a slow link?: No
    
    
    COMPUTER SETTINGS
    ------------------
        CN=NTECH2-PC,OU=Workstations,OU=NTech,DC=ntechdc,DC=ntechshop,DC=com
        Last time Group Policy was applied: 10/20/2011 at 11:38:51 AM
        Group Policy was applied from:      server1.ntechdc.ntechshop.com
        Group Policy slow link threshold:   500 kbps
        Domain Name:                        NTECHDC
        Domain Type:                        Windows 2000
    
        Applied Group Policy Objects
        -----------------------------
            Default Domain Policy
    
        The following GPOs were not applied because they were filtered out
        -------------------------------------------------------------------
            NTechShop
                Filtering:  Not Applied (Empty)
    
            Local Group Policy
                Filtering:  Not Applied (Empty)
    
        The computer is a part of the following security groups
        -------------------------------------------------------
            BUILTIN\Administrators
            Everyone
            BUILTIN\Users
            NT AUTHORITY\NETWORK
            NT AUTHORITY\Authenticated Users
            This Organization
            NTECH2-PC$
            Domain Computers
            System Mandatory Level
    
    
    USER SETTINGS
    --------------
        CN=Chris Newman,OU=Users,OU=NTech,DC=ntechdc,DC=ntechshop,DC=com
        Last time Group Policy was applied: 10/20/2011 at 12:24:15 PM
        Group Policy was applied from:      server1.ntechdc.ntechshop.com
        Group Policy slow link threshold:   500 kbps
        Domain Name:                        NTECHDC
        Domain Type:                        Windows 2000
    
        Applied Group Policy Objects
        -----------------------------
            NTechShop
            Default Domain Policy
    
        The following GPOs were not applied because they were filtered out
        -------------------------------------------------------------------
            Local Group Policy
                Filtering:  Not Applied (Empty)
    
        The user is a part of the following security groups
        ---------------------------------------------------
            Domain Users
            Everyone
            BUILTIN\Users
            BUILTIN\Administrators
            NT AUTHORITY\INTERACTIVE
            CONSOLE LOGON
            NT AUTHORITY\Authenticated Users
            This Organization
            LOCAL
            Domain Admins
            Group Policy Creator Owners
            NTechShop
            Enterprise Admins
            Schema Admins
            Denied RODC Password Replication Group
            Scan Operators
            High Mandatory Level
    If I run the script locally on the Windows 7 Ultimate machine the script works fine, its just not pushing out from the server at logon. I also tried to set
    I have experience setting up networks, but have never done one alone, and I'm really just trying to create this for a practice environment.

    Thanks in advance.

  2. #2
    Join Date
    Dec 2007
    Posts
    2,291

    Re: VBS Script in Server 2008R2

    You can try the below suggestions and try if it fixex the issue:

    • Firts of all you have to browse to the installation\bin folder (default: C:\Program Files\Microsoft Identity Integration Server\Bin)
    • After that run "mofcomp mmswmi.mof"

Similar Threads

  1. The DNS server was unable to open Active Directory windows 2008r2
    By petergriffin in forum Operating Systems
    Replies: 1
    Last Post: 22-07-2011, 03:22 AM
  2. Trying to add Server 2008R2 to a 2003 domain
    By JohnFli in forum Windows Server Help
    Replies: 4
    Last Post: 09-07-2011, 12:22 AM
  3. sbs 2003 to 2008r2
    By expmicro in forum Windows Server Help
    Replies: 1
    Last Post: 01-05-2011, 07:42 AM
  4. Replies: 5
    Last Post: 20-08-2010, 11:07 PM
  5. Need Script for MS SQL Server
    By Saura in forum Software Development
    Replies: 4
    Last Post: 06-03-2010, 01:46 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,030,186.37762 seconds with 17 queries