WINS divestiture:Return to IT/SA Services Documentation Home |
Lead: was Chris HughesDescription:We are in the planning stages of removing WINS from the IFAS Network on campus by removing the references to WINS in our DHCP server's advertised information. This was first proposed at the January 2006 ICC meeting and a trial removal was to be implemented on the first of February. Since that time, Chris discovered that some login scripts still used old netbios names. Chris assumes that other links like printers and drive mappings to those also exist elsewhere. Chris wrote the following script that was implemented on March 6th to dump all current mappings. Chris he will send that to the OU Admins for correction before we move on this. |
'on error resume next Wscript.Sleep 20000 Set objNetwork = CreateObject("Wscript.Network") Set objConnection = CreateObject("ADODB.Connection") Set objRecordset = CreateObject("ADODB.Recordset") objConnection.CommandTimeout=5 objConnection.Open "Driver={SQL Server};Server=IF-SRV-SQL02.AD.UFL.EDU;Database=AD-APPS" Set colDrives = objNetwork.EnumNetworkDrives objConnection.Execute "DELETE FROM DriveMappings where ComputerName = '" & objNetwork.ComputerName & "'" For i = 0 to colDrives.Count-1 Step 2 objConnection.Execute "INSERT INTO DriveMappings (ComputerName, DriveName, Username, Updated) VALUES ('" & objNetwork.ComputerName & "', '" & colDrives.Item (i + 1) & "', '" & objNetwork.UserName & "', '" & Now() & "')" Next Set objNetwork = WScript.CreateObject("WScript.Network") Set colPrinters = objNetwork.EnumPrinterConnections objConnection.Execute "DELETE FROM PrinterMappings where ComputerName = '" & objNetwork.ComputerName & "'" For i = 0 to colPrinters.Count-1 Step 2 objConnection.Execute "INSERT INTO PrinterMappings (ComputerName, PrinterName, Username, Updated) VALUES ('" & objNetwork.ComputerName & "', '" & colPrinters.Item (i + 1) & "', '" & objNetwork.UserName & "', '" & Now() & "')" Next