Wednesday, June 27, 2012

Useful Commands

Exchange 2010 Mailbox
Get-MailboxStatistics zawhtet | ft DisplayName, TotalItemSize, ItemCount

Check All the Mailbox Size (Need to type on MailboxServer)

Get-MailboxDatabase | Get-MailboxStatistics | Sort totalitemsize -desc | ft displayname, totalitemsize, itemcount > d:\Database.txt

systeminfo

netstat -a -o -n  <==== check all the ports listening
netstat -ab

Windows XP, 2003 System State Backup
#ntbackup backup systemstate /J "System state backup Job" /F "E:\system-state-backup.bkf"

Windows 2008, 2008 R2 System State Backup
#C:\>WBADMIN   START    SYSTEMSTATEBACKUP         -backuptarget:E:

Using "MAC OF" to flood mac-address on Switch
macof    -i   eth1    -n    5

Clear Outlook2010 Temp Folder
ATTRIB "C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\*.*" -R /s

del "C:\Users\%username%\AppData\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook\" /s /q

Outlook 2010 diagnostic Mode
C:\Program Files (x86)\Microsoft Office\Office14>outlook.exe /rpcdiag

OR,

Press WinKey+R. In the Open field, type outlook.exe /resetnavpane


OR,
Press WinKey+R. In the Open field, type regedit and hit Enter
Delete the following key to delete profile, once deleted re-create the profile.

HKEY_CURRENT_USER\Software\Microsoft\Windows NT\ CurrentVersion\Windows
Messaging Subsystem\ Profiles

Turn On System Protection Windows 7 (PowerShell)
 
disable-computerrestore "C:"
To enable System Restore:
enable-computerrestore "C:"
Command to set diskpace used for previous files versions (example):
vssadmin Resize ShadowStorage /For=C: /On=C: /Maxsize=5%
or

vssadmin Resize ShadowStorage /For=C: /On=C: /Maxsize=10GB
 
--------------------------------------------------------------------------------
        
When you open System Properties and select the System Protection tab, the Create button may be grayed out, and the following message is displayed:
Restore point creation disabled by Group Policy

As a result, you’re unable to create System Restore Points or configure System Restore.

Resolution

This happens if the Turn off Configuration Policy is enabled in your system, either using Group Policy or through registry edit. For standalone Windows Vista systems, use these steps:
Using the Group Policy Editor
If your edition of Windows Vista includes the Group Policy Editor snap-in (gpedit.msc), follow these steps:
1. Click Start, type gpedit.msc and press ENTER
2. Go to the following branch:
Computer Configuration | Administrative Templates | System | System Restore
3. Double-click Turn off Configuration and set it to Not configured.
Note: If the above setting is already set to Not configured, set it to Enabled and click Apply. Then revert back the setting to Not configured, and click Apply, OK.
4. Exit the Group Policy Editor.
Using the Registry Editor
1. Click Start, type regedit.exe and press ENTER
2. Navigate to the following key:
HKEY_LOCAL_MACHINE \ Software \ Policies \ Microsoft \ Windows NT \ SystemRestore
3. In the right-pane, delete the value named DisableConfig
4. Exit the Registry Editor.
Registry Fix
To automate the above setting, download srpol-clear.reg and save to Desktop. Right-click on the file and choose Merge.

More Information

If you set the Turn of configuration option to Enabled, the option to configure System Restore on the Configuration Interface disappears. If the Turn off Configuration setting is disabled, the configuration interface is still visible, but all System Restore configuration defaults are enforced, and the Create button is grayed out. If you set it to Not configured, the configuration interface for System Restore remains, and the user has the ability to configure System Restore.

Edit "Hosts" File under C:\windows\System32\Drivers\etc\hosts with command

echo 1.2.3.4 hostname.domain.com >> %windir%\system32\drivers\etc\hosts

No comments:

Quote of the Day