here is the startup script using snetcfg.exe that I used successfully:



SetLocale "en-us"  ' do not remove

If GetOsVersionNumber = 5.0 Then
  sSnetcfgPath = "\\sharepath\snetcfgw2k\snetcfg.exe"
Elseif GetOsVersionNumber = 5.1 Then
  sSnetcfgPath = "\\sharepath\snetcfgwxp\snetcfg.exe"
Else
  ' unsupported OS
  WScript.Quit
End If

Set oShell = CreateObject("WScript.Shell")

sUninstCmd = Chr(34) & sSnetcfgPath & Chr(34) & " -u MS_Server"
oShell.Run sUninstCmd, 0, True

sInstCmd = Chr(34) & sSnetcfgPath & Chr(34) & " -l " _
           & "%windir%\Inf\NETSERV.INF -c s -i MS_Server"
oShell.Run sInstCmd, 0, True


Function GetOsVersionNumber()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Determines OS by reading reg val & comparing to known values
' OS version number returned as number of type double:
'    Windows 2k:   5
'    Windows XP:   5.1
'    Windows Server 2003: 5.2
'    Windows x:  >5.2
'
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  Dim oShell, sOStype, sOSversion
  Set oShell = CreateObject("Wscript.Shell")

  On Error Resume Next
  sOStype = oShell.RegRead(_
    "HKLM\SYSTEM\CurrentControlSet\Control\ProductOptions\ProductType")
  If Err.Number<>0 Then
    ' Hex(Err.Number)="80070002"
    ' - Could not find this key, OS must be Win9x
    Err.Clear

    sOStype = oShell.RegRead(_
      "HKLM\SOFTWARE\Microsoft\Windows" & _
      "\CurrentVersion\VersionNumber")

    Select Case sOStype
      Case "4.00.950"
        sOSversion = 1   ' Windows 95A
      Case "4.00.1111"
        Dim sSubVersion
        sSubVersion = oShell.RegRead(_
          "HKLM\SOFTWARE\Microsoft\Windows" & _
          "\CurrentVersion\SubVersionNumber")
        Select Case sSubVersion
          Case " B"
            sOSversion = 1   ' Windows 95B
          Case " C"
            sOSversion = 1   ' Windows 95C
          Case Else
            sOSversion = 1   ' Unknown Windows 95
        End Select
      Case "4.03.1214"
        sOSversion = 1   ' Windows 95B
      Case "4.10.1998"
        sOSversion = 2   ' Windows 98
      Case "4.10.2222"
        sOSversion = 2   ' Windows 98SE
      Case "4.90.3000"
        sOSversion = 3   ' Windows Me
      Case Else
        sOSversion = 1   ' Unknown W9x/Me
    End Select
  Else  ' OS is NT based
    sOSversion = oShell.RegRead(_
      "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
    If Err.Number<>0 Then
      GetOsVersion = "Unknown NTx"
      ' Could not determine NT version
      Exit Function  ' >>>
    End If
  End If

  ' Setting Locale to "en-us" to be indifferent to country settings.
  ' CDbl might err else
  SetLocale "en-us"
  GetOsVersionNumber = CDbl(sOSversion)
End Function






















>>> [EMAIL PROTECTED] 4/11/2006 9:51:26 AM >>>

Maybe a GPO with a startup script using snetcfg.exe

 

-----Original Message-----
From: Joe Lagreca [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 11, 2006 9:36 AM
To: [email protected] 
Subject: [ActiveDir] Can GPO be used to enable File and Printer sharing?

I am using ADMT v3 to migrate workstations from our old domain to the
new one.  One problem I have ran into is some workstations don't have
file and printer sharing enabled, so the ADMT agent cannot be deployed
to them.

I'm looking for a way to ensure all workstations to be migrated have
file and printer sharing enabled.  Does anyone know of a way to do
this with GPO?
List info   : http://www.activedir.org/List.aspx 
List FAQ    : http://www.activedir.org/ListFAQ.aspx 
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

List info   : http://www.activedir.org/List.aspx 
List FAQ    : http://www.activedir.org/ListFAQ.aspx 
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

List info   : http://www.activedir.org/List.aspx
List FAQ    : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to