Showing posts with label scripting. Show all posts
Showing posts with label scripting. Show all posts

Monday, June 23, 2008

VbScript - Password Reset CS5 Fortres 6

'on error resume next
dim status
dim filesys
dim ccfilesys
Set ccfilesys = CreateObject("Scripting.FileSystemObject")
Set filesys = CreateObject("Scripting.FileSystemObject")
If filesys.FolderExists("c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\") Then
StorageType
Else
CCsub
End If

dim choice
choice = MsgBox("Do you want to delete this Password Reset file? (Recommended)", vbYesNo)
If choice = 6 then
'Delete the script
DeleteSelf
else
wscript.quit
end if


Sub DeleteSelf()
Dim objFSO
'Create a File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Delete the currently executing script
objFSO.DeleteFile WScript.ScriptFullName
Set objFSO = Nothing
End Sub

Sub Storagetype

If filesys.FolderExists("c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\settings\") Then

Set WshShell = CreateObject( "WScript.Shell" )
objStorageValue = WshShell.RegRead("HKLM\Software\Fortres Grand\FSRT\StorageType")
If objStorageValue = 2 then
wscript.echo "Please run this program on your Central Control Server."
wscript.quit
Else
wscript.echo "Storage is set for local machine."

End If

If filesys.FileExists("c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\Settings\appmgr.ad") then
file = "true"
filesys.DeleteFile "c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\Settings\appmgr.ad"

End If


If file = "true" then
wscript.echo "Old Password Deleted"
Else
wscript.echo "Password file does not exist." & vbCL & " A new file will be created."
End If


strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer)

If filesys.FileExists("c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\Settings\appmgr.default") Then
file = "true"
Set objFile = objWMIService.Get _
("CIM_DataFile.Name='c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\Settings\appmgr.default'")
intReturn = objFile.Copy("c:\Program Files\Fortres Grand\Fortres Security Runtime 6.0\Settings\appmgr.ad")
End If
If file = "true" then
wscript.echo "Your Password is now 'password'"
Else
wscript.echo "Default file missing." & vbCL & " Please contact Technical Support."
wscript.quit
End If
Else
wscript.echo "Clean Slate 5.0 or Fortres 101 6.0 is not installed on this machine."
wscript.quit
End if
End Sub

Sub CCSUB
dim ccfilesys
set ccfilesys = CreateObject("Scripting.FileSystemObject")
If ccfilesys.FileExists("c:\Program Files\Fortres Grand\Central Control 6.0\Settings\appmgr.ad") Then
ccfile = "true"
ccfilesys.DeleteFile "c:\Program Files\Fortres Grand\Central Control 6.0\Settings\appmgr.ad"
End if

If ccfile = "true" then
wscript.echo "Old Password Deleted"
Else
wscript.echo "Password file does not exist." & vbCL & " A new file will be created."
End If


strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer)

If ccfilesys.FileExists("c:\Program Files\Fortres Grand\Central Control 6.0\Settings\appmgr.default") Then
Set objFile = objWMIService.Get _
("CIM_DataFile.Name='c:\Program Files\Fortres Grand\Central Control 6.0\Settings\appmgr.default'")
intReturn = objFile.Copy("c:\Program Files\Fortres Grand\Central Control 6.0\Settings\appmgr.ad")
ccfile = "true"

End if

If ccfile = "true" then
wscript.echo "Your Password is now 'password'"
Else
wscript.echo "Default file missing." & vbCL & " Please contact Technical Support."
wscript.quit
End If
End Sub

BAT and VBScript files to self-extracting EXE files

http://renegadetech.blogspot.com/2006/07/how-to-convert-bat-file-or-vbs-file.html

Self Deleting Script

http://www.bytemycode.com/snippets/snippet/426/

Monday, June 9, 2008

How to replace single domain controller in domain with a single domain controller?

How to replace single domain controller in domain with a single domain controller?

 

A

 
The following article describe a guidelines to replace exiting Windows 2003
Domain Controller with a new server.
 
The article assume the following pre-requirement settings.
 
1. There no Exchange/SQL server etc. on the current Domain Controller.
 
2. There only one domain, and there only one domain controller function as:
 
      DHCP/WINS/DNS/File Server/Print Server.
 
3. The source server using regular (No SBS) Windows 2003 Standard or higher.
 
 
The following steps need to be taken to replace the exiting Domain Controller.
 
 
1. Install the Windows 2003 Standard or higher on a new server.
 
     Tip: You will need to setup the current Domain Controller as DNS server.
 
2. Promote the new server to become Domain Controller (in the same domain).
 
Step-by-Step Guide to Setting Up Additional Domain Controllers
 
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/directory/activedirectory/stepbystep/addomcon.mspx
 
3. Promote the new Domain Controller to be "Global Catalog" and reboot the server.
 
Enable or disable a global catalog
 
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/7b1c3e1c-ef32-4b8e-b4c4-e73910575f61.mspx
 
4. Install DNS server on the new Domain Controller.
 
How To Integrate Windows Server 2003 DNS with an Existing DNS Infrastructure in Windows Server 2003
 
http://support.microsoft.com/kb/323417

How To Install and Configure DNS Server in Windows Server 2003

http://support.microsoft.com/default.aspx?scid=kb;en-us;814591
 
5. Set the local IP of the new Domain Controller as DNS server.
 
6. Option - Install WINS service on the new Domain Controller and change
 
       the Domain Controller IP settings to point on the local IP as WINS server IP.
 
Tip: You can migrate the current WINS database to the new server.
 
How to migrate a WINS Database from Windows 2000-based WINS server to a Windows 2003-based WINS server
 
http://support.microsoft.com/default.aspx?scid=kb;en-us;875419
 
7. Move FSMO rules to the new Domain Controller.
 
How to view and transfer FSMO roles in the graphical user interface
 
http://support.microsoft.com/default.aspx?scid=kb;en-us;255690
 
8. Demote the original Domain Controller from using as "Global Catalog" and reboot the server.
 
Enable or disable a global catalog
 
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ServerHelp/7b1c3e1c-ef32-4b8e-b4c4-e73910575f61.mspx
 
9. Demote the original Domain Controller from using as "Domain Controller".
 
10. Migrate printer settings from the old server to the new one by using "Windows Print Migrator 3.1" tool.
 
Microsoft Windows Server 2003 Print Migrator 3.1
 
http://www.microsoft.com/WindowsServer2003/techinfo/overview/printmigrator3.1.mspx
 
11. Migrate File Server settings from the old server to the new one by using "Microsoft File Server Migration Toolkit".
 
Microsoft File Server Migration Toolkit
 
http://www.microsoft.com/windowsserver2003/upgrading/nt4/tooldocs/msfsc.mspx
 
12. Install DHCP server on the Domain Controller and migrate the DHCP settings from the old server.
 
How to move a DHCP database from a computer that is running Windows NT Server 4.0, Windows 2000, or Windows Server 2003 to a computer that is running Windows Server 2003
 
http://support.microsoft.com/default.aspx?scid=kb;en-us;325473
 
 
Tip: Don’t forget to set the new Domain Controller as DNS & WINS (Optionally) for the DHCP scope/s.
 
13. Edit users profiles and/or user logon scripts to point to the new Domain Controller as File Server and
       Printer server.
 
14. Uninstall unnecessary services from the old Domain Controller.
 
15. Install third party tools on the new Domain Controller (Backup Software, Antivirus etc.)
 
16. Re-register users computers in the new DHCP by using ipconfig /release and ipconfig /renew.