Turn on remote PC and access BIOS remotely


Advertisements

Boot Defragment


A very important new feature in Microsoft Windows XP is the ability to do a boot defragment. This basically means that all boot files are placed next to each other on the disk drive to allow for faster booting. By default this option is enabled but some upgrade users have reported that it isn’t on their setup.

1. Start Regedit.
2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Dfrg\BootOptimizeFunction
3. Select Enable from the list on the right.
4. Right on it and select Modify.
5. Change the value to Y to enable and N to disable.
6. Reboot your computer.

XP will not Restore my Active Desktop


Method 1

Right click on a blank area of the desktop and select Properties.

desktop-properties

Now select the Desktop tab, then press the Customize Desktop button.

customize-desktop

Here is the strange part.

Make a change to the Desktop icons section by selecting or deselecting one of them, then press OK.

desktop-icons

Now press Apply.

apply-settings

If Method 1 was going to work, your Active Desktop message should have disappeared and you should have your standard desktop back.

 

If Method 1 did not work, try Method 2.

Method 2

Open up your registry: Start -> Run

*Warning: Be careful what you are doing when in the registry. It’s very easy to make your computer non-usable if you edit the wrong entry.

Type regedit

regedit

Expand the following:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\SafeMode\Components\

regedit-section

Double-click on DeskHtmlVersion, select the Desimal radio-button, and change the value from 272 to 0.

Then press OK.

regedit-change

Close out of Registry Editor, click in a blank area of your desktop, and press F5 to refresh the screen.

You should be back at your normal background/wallpaper.

Pat yourself on the back for a job well-done!

Security Event Log backup


The following script clears the Security event log after backing it up to a folder mentioned in the script. To run the script, copy the following contents to Notepad, and save the file with .vbs extension. Double-click to run the file.

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate, (Backup, Security)}!\\” _
& strComputer & “\root\cimv2”)
Set colLogFiles = objWMIService.ExecQuery _
(“Select * from Win32_NTEventLogFile where LogFileName=’Security'”)
For Each objLogfile in colLogFiles
OutputFile = “C:\” & “Security ”
OutputFile = OutputFile & Day(Now) & “-” & month(now) & “-” & year(now)
OutputFile = OutputFile & “.evt”
errBackupLog = objLogFile.BackupEventLog(OutputFile)
If errBackupLog = 0 Or errBackupLog = 183 Then
objLogFile.ClearEventLog()
Else
Wscript.Echo “The Security event log could not be backed up.”
End If
Next

By default it backs up to C:\ root directory. You can change the path in the script accordingly. The backup file name format will be like this: (contains the date stamp)

  • Security 19-6-2006.evt
  • Security 20-6-2006.evt
  • Security 21-6-2006.evt
  • Security 22-6-2006.evt

If the file with the same name already exists (which means the log has already been backed up for the current day), it ignores the error and clears the Security log.

Event Log Backup script


Step 1 : Copy This code in Notepad

Step 2:save As BackupEventLogs.vbs

Step 3:Run this script

Step 4: Go to C:\Backup\Event Logs

Enjoy..,!

 

‘—————————————————————————————————————————-
‘Script Name : BackupEventLogs.vbs
‘Author      : Matthew Beattie
‘Created     : 02/02/09
‘Description : This script backs up multiple event logs on the system and logs the results to the scripts working directory.
‘—————————————————————————————————————————-
‘Initialization  Section
‘—————————————————————————————————————————-
Option Explicit
Const ForAppending = 8
Dim objFSO, wshNetwork, scriptBaseName, scriptPath, scriptLogPath
On Error Resume Next
Set objFSO     = CreateObject(“Scripting.FileSystemObject”)
Set wshNetwork = CreateObject(“Wscript.Network”)
scriptBaseName = objFSO.GetBaseName(Wscript.ScriptFullName)
scriptPath     = objFSO.GetFile(Wscript.ScriptFullName).ParentFolder.Path
scriptLogPath  = scriptPath & “\” & scriptBaseName
If Err.Number <> 0 Then
Wscript.Quit
End If
On Error Goto 0
‘—————————————————————————————————————————-
‘Main Processing Section
‘—————————————————————————————————————————-
On Error Resume Next
ProcessScript
If Err.Number <> 0 Then
Wscript.Quit
End If
On Error Goto 0
‘—————————————————————————————————————————-
‘Functions Processing Section
‘—————————————————————————————————————————-
‘Name       : ProcessScript -> Primary Function that controls all other script processing.
‘Parameters : None          ->
‘Return     : None          ->
‘—————————————————————————————————————————-
Function ProcessScript
Dim hostName, logNames, folderSpec
hostName   = wshNetwork.ComputerName
logNames   = Array(“Application”,”Security”,”System”)
folderSpec = “C:\Backup\Event Logs”
If Not objFSO.FolderExists(folderSpec) Then
If Not CreateFolder(folderSpec) Then
Exit Function
End If
End If
If Not BackupEventLogs(hostName, logNames, folderSpec) Then
Exit Function
End If
End Function
‘—————————————————————————————————————————-
‘Name       : BackupEventLogs -> Backups an array of event log names on a system.
‘Parameters : hostName        -> String containing the hostName of the system to backup the event log\logs on.
‘           : logNames        -> Array containing the event log names to backup.
‘           : backupPath      -> String containing the UNC folder path of the backup location.
‘Return     : BackupEventLogs -> Returns True if all specified event log names were backed up otherwise returns False.
‘—————————————————————————————————————————-
Function BackupEventLogs(hostName, logNames, backupPath)
Dim wmi, query, results, result, errorCount, i
errorCount     = 0
BackupEventLogs = False
If Not IsArray(logNames) Then
logNames = Array(logNames)
End If
On Error Resume Next
Set wmi = GetObject(“winmgmts:” & “{impersonationLevel=impersonate,(Security,Backup)}!\\” & hostName & “\root\cimv2”)
If Err.Number <> 0 Then
LogError “Creating WMI object to connect to ” & DQ(hostName)
Exit Function
End If
For i = 0 To UBound(logNames)
Do
query = “Select * from Win32_NTEventLogFile Where LogFileName=” & SQ(logNames(i))
Set results = wmi.ExecQuery(query)
If Err.Number <> 0 Then
LogError “Executing WMI query ” & DQ(query) & ” on ” & DQ(hostName)
errorCount = errorCount + 1
Exit Do
End If
For Each result In results
result.BackupEventLog(backupPath & “\” & logNames(i) & “.evt”)
If Err.Number <> 0 Then
LogError “Backing up the ” & DQ(logNames(i)) & ” Event Log on ” & DQ(hostName)
Exit Do
End If
LogMessage “The ” & DQ(logNames(i)) & ” Event Log on ” & DQ(hostName) & ” was ” & _
“successfully backed up to ” & DQ(backupPath & “\” & logNames(i) & “.evt”)
Next
Loop Until True
Next
On Error Goto 0
BackupEventLogs = True
End Function
‘—————————————————————————————————————————-
‘Name       : CreateFolder -> Recursive Function to Create a directory structure or single folder.
‘Parameters : folderSpec   -> Path of folder\folders to create.
‘Return     : CreateFolder -> Returns True if the directory structure was successfully created otherwise returns False.
‘—————————————————————————————————————————-
Function CreateFolder(folderSpec)
CreateFolder = False
If Not objFSO.FolderExists(folderSpec) Then
If InStrRev(folderSpec, “\”) <> 0 Then
If Not CreateFolder(Left(folderSpec, InStrRev(folderSpec, “\”) – 1)) Then
Exit Function
End If
End If
On Error Resume Next
objFSO.CreateFolder folderSpec
If Err.Number <> 0 Then
LogError “Creating folder ” & DQ(folderSpec)
Exit Function
End If
On Error Goto 0
End If
CreateFolder = True
End Function
‘—————————————————————————————————————————-
‘Name       : DQ          -> Place double quotes around a string and replace double quotes
‘           :             -> within the string with pairs of double quotes.
‘Parameters : stringValue -> String value to be double quoted
‘Return     : DQ          -> Double quoted string.
‘—————————————————————————————————————————-
Function DQ (ByVal stringValue)
If stringValue <> “” Then
DQ = “””” & Replace (stringValue, “”””, “”””””) & “”””
Else
DQ = “”””””
End If
End Function
‘—————————————————————————————————————————-
‘Name       : SQ          -> Places single quotes around a string
‘Parameters : stringValue -> String value to be single quoted
‘Return     : DQ          -> Single quoted string.
‘—————————————————————————————————————————-
Function SQ(ByVal stringValue)
If stringValue <> “” Then
SQ = “‘” & stringValue & “‘”
End If
End Function
‘—————————————————————————————————————————-
‘Name      : LogMessage -> Parses a message to the log file.
‘Parameters: message    -> String containnig the message to include in the log file.
‘Return    : None       ->
‘—————————————————————————————————————————-
Function LogMessage(message)
If Not LogToFile(scriptLogPath & “.log”, message) Then
Exit Function
End If
End Function
‘—————————————————————————————————————————-
‘Name      : LogError -> Logs the current information about the error object.
‘Parameters: message  -> String containnig the message that relates to the process that caused the error.
‘Return    : None     ->
‘—————————————————————————————————————————-
Function LogError(message)
Dim errorMessage
errorMessage = “Error ” & Err.Number & ” (Hex ” & Hex(Err.Number) & “) ” & message & “. ” & Err.Description
If Not LogToFile(scriptLogPath & “.err”, errorMessage) Then
Exit Function
End If
End Function
‘—————————————————————————————————————————-
‘Name       : LogToFile -> Write a message into the user’s network log file.
‘Parameters : LogSpec   -> String containing the Folder path, file name and extension of the log file to write to.
‘           : message   -> String containing the Message to be logged.
‘Return     : LogToFile -> Returns True if successful otherwise returns false.
‘—————————————————————————————————————————-
Function LogToFile(logSpec, message)
LogToFile = False
On Error Resume Next
With objFSO.OpenTextFile(logSpec, ForAppending, True)
.WriteLine Date & ” ” & Time & ” ” & message
.Close
End With
If Err.Number <> 0 Then
Exit Function
End If
On Error Goto 0
LogToFile = True
End Function
‘—————————————————————————————————————————-

Active Directory Rights Management Services


Active Directory Federation Services


%d bloggers like this: