Tuesday, March 25, 2014

List Applications Installed on a Remote or Local Machine with Powershell

Joe Piggeé

This one-liner will list all application on your local computer, or remote computer. If you do not include the -Computername parameter, it will list all applications on your local machine.

Get-Wmi -Class Win32_Product -Computername TypeComputerNameHere | Select-Object -Property Name

 

*http://technet.microsoft.com/en-us/library/bb978526.aspx

PePELePuu

Sunday, March 2, 2014

PowerShell: Get Printer Information

By: Joe Piggee

$PrintServer=Read-host "Enter the Print Server Name"

$SavePath="c:\temp\$PrintServer.csv"

Get-WMIObject -class Win32_Printer -computer $printserver | Select Name,DriverName,PortName | Export-CSV -path $savepath

Write-Host "File saved to:" $SavePath

Tuesday, February 25, 2014

How to Reset your Lost Admin Password from the Command-Line

 

  1. Logon your Windows as administrator(You also can logon Safe Mode with Command Prompt, pressing F8 when restart your computer, hit up/down key to choose Safe Mode with Command Prompt and hit Enter).
  2. Click on Start, type cmd in the Run box or Search box and press Enter.
  3. Type net user, all user accounts of your computer will be listed.
  4. Type net user "UserName" "NewPassword"(replace UserName and NewPassword with yours), press Enter
  5. Then the password will be reset as new one and you can logon

Joe Piggee

Thursday, October 17, 2013

Powershell: Restart a Remote Machine

Option 1: Prompt user for machine name to be restarted
CLS $cname = Read-Host "Enter Machine Name or IP Address" Restart-Computer -computerName $cname -Force

 Option 2: Enter the name directly in the code. cls Restart-Computer -computerName "EnterMachineNameHere" -Force

 Option 3: Reboot multiple Machines
cls $cname ="Server01, Server02, Server03" Restart-Computer -computer $cname -force

Joe Piggee





Powershell: List services on remote machine

# Use This to list\view services on remote server(s)
#Joe Piggee
---  Begin Code----
cls
gwmi win32_service -comp (gc c:\servers.txt) | select __server,name,startmode,state,status | Out-Gridview

--- End Code ---

Disable IPv6

 

By Joseph Piggee Sr.

http://support.microsoft.com/kb/929852

IPv6 can be disabled either through the DisabledComponents registry value or through the check box for the Internet Protocol Version 6 (TCP/IPv6) component in the list of items on the Networking tab for the properties of connections in the Network Connections folder. The following figure shows an example.

The DisabledComponents registry key affects all interfaces on the host. However, the check box on the Networking tab affects only the specific interface. The DisabledComponents registry value does not affect the state of the check box. Therefore, even if the DisabledComponents registry key is set to disable IPv6, the check box in the Networking tab for each interface can still be checked. This is expected behavior.

Note Unchecking the checkbox on a network adapter will not disable IPv6 on the host. It will unbind IPv6 from this adapter. To disable IPv6 on the host, follow the steps below.

To use the DisabledComponents registry value to check whether IPv6 was disabled, run the following command at a Windows command prompt: 
reg query HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters /v DisabledComponents

You may receive the following error message: 
ERROR: The system was unable to find the specified registry key or value. 
If you receive this error message, the DisabledComponents registry value is not set. If the DisabledComponents value is set, it overrides the settings in the connection properties. 

To enable or to disable IPv6 or to selectively enable or disable components of IPv6 automatically, click the Fix this problem link. Then, click Runin the File Download dialog box, and follow the steps in this wizard.

Backup Active Directory

Joe Piggee

  1. Open NTBACKUP by either going to Run, then NTBACKUP and pressing Enter or by going to  Start / Accessories / System Tools. Or my personal method, Click Start/ Run/ Type NTBACKUP.
  2. If you are prompted by the Backup or Restore Wizard, I suggest you un-check the "Always Start in Wizard Mode" checkbox, and click on the Advanced Mode link.
  3. Inside NTBACKUP's main window, click on the Backup tab.
  4. Click to select the System State checkbox. Note you cannot manually select components of the System State backup. It's all or nothing.
  5. Enter a backup path for the BKF file. If you're using a tape device, make sure NTBACKUP is aware and properly configured to use it.
    Press Start Backup.
  6. The Backup Job Information pops out, allowing you to configure a scheduled backup job and other settings. For the System State backup, do not change any of the other settings except the schedule, if so desired. When done, press Start Backup. After a few moments of configuration tasks, NTBACKUP will begin the backup job.
  7. When the backup is complete, review the output and close NTBACKUP.