List a Client Machine informations with PowerShell

Here are two scripts, which can assist in getting hardware information about the computers on an active directory network. It'll get you the following information in a CSV file:

  1. Hostname
  2. Model
  3. RAM
  4. CPU
  5. Serial Number
  6. Manufacturer
  7. Operating System
  8. HDD Capacity
  9. HDD Space
  10. IP Address

If your DC has PowerShell V2 use this:

## FOR MACINES WITH POWERSHELL V2
Import-Module ActiveDirectory
$ComputerList = Get-ADComputer -filter * -Properties *
$csvpath = "C:\users\icuadminaccount\Desktop\Computers.csv"
foreach ($Computer in $ComputerList) {
##Title
$computerSystem = Get-WmiObject -ComputerName $Computer.Name -Class CIM_ComputerSystem
$output = "System Information for: " + $computerSystem.Name +"`n"
$output = $output + "Model: " + $computerSystem.Model +"`n"
$output = $output + "RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB"+"`n"
##CPU
$computerCPU = Get-WmiObject -ComputerName $Computer.Name -Class CIM_Processor
$output = $output + "CPU: " + $computerCPU.Name +"`n"
Out-file -FilePath $csvpath -append
##BIOS
$computerBIOS = Get-WmiObject -ComputerName $Computer.Name -Class CIM_BIOSElement
$output = $output + "Serial Number: " + $computerBIOS.SerialNumber +"`n"
$output = $output + "Manufacturer: " + $computerBIOS.Manufacturer +"`n"
Out-file -FilePath $csvpath -append
##OS
$computerOS = Get-WmiObject -ComputerName $Computer.Name -Class CIM_OperatingSystem
$output = $output + "Last Reboot: " + $computerOS.LastBootUpTime +"`n"
$output = $output + "Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion +"`n"
Out-file -FilePath $csvpath -append
##Disks
$computerHDD = Get-WmiObject -ComputerName $Computer.Name -Class Win32_LogicalDisk -filter "DeviceID = 'C:'"
$output = $output + "HDD Capacity: " + "{0:N2}" -f ($computerHDD.Size/1024) + "GB" +"`n"
$output = $output + "HDD Space: " + "{0:P2}" -f ($computerHDD.FreeSpace/1024) + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace) + "KB)" +"`n"
$output | Out-file -FilePath $csvpath -append
}

If your DC has PowerShell V3+ use this:

## FOR MACINES WITH POWERSHELL V3+
Import-Module ActiveDirectory
$ComputerList = Get-ADComputer -filter * -Properties *
$csvpath = "C:\users\icuadminaccount\Desktop\Computers.csv"
foreach ($Computer in $ComputerList) {

$computerSystem = Get-CimInstance CIM_ComputerSystem
$computerBIOS = Get-CimInstance CIM_BIOSElement
$computerOS = Get-CimInstance CIM_OperatingSystem
$computerCPU = Get-CimInstance CIM_Processor
$computerHDD = Get-CimInstance Win32_LogicalDisk -filter "DeviceID = 'C:'"


$output = "System Information for: " $computerSystem.Name -BackgroundColor DarkCyan
$output = $output + "Manufacturer: " + $computerSystem.Manufacturer
$output = $output + "Model: " + $computerSystem.Model
$output = $output + "Serial Number: " + $computerBIOS.SerialNumber
$output = $output + "CPU: " + $computerCPU.Name
$output = $output + "HDD Capacity: " + "{0:N2}" -f ($computerHDD.Size/1GB) + "GB"
$output = $output + "HDD Space: " + "{0:P2}" -f ($computerHDD.FreeSpace/$computerHDD.Size) + " Free (" + "{0:N2}" -f ($computerHDD.FreeSpace/1GB) + "GB)"
$output = $output + "RAM: " + "{0:N2}" -f ($computerSystem.TotalPhysicalMemory/1GB) + "GB"
$output = $output + "Operating System: " + $computerOS.caption + ", Service Pack: " + $computerOS.ServicePackMajorVersion
$output = $output + "User logged In: " + $computerSystem.UserName
$output = $output + "Last Reboot: " + $computerOS.LastBootUpTime
$output | Out-file -FilePath $csvpath -append
}

Enable the Password Reset Option in Exchange Server

1. Log in to exchange server with your admin credentials.

Add-pssnapin microsoft*

Install-CannedRbacRoles

Install-CannedRbacRoleAssignments

3. Log in to the Exchange Admin Center and click on Permissions.

Right-click ‘Organization Management’ and then click Edit.

Click the ‘+’ sign on the roles section. Select ‘Reset Password’ and then click Add. Click OK and then click Save.

4. Log out from the Exchange Admin Center.

5. When you log in again to the Exchange Admin Center and open any existing user mailbox properties, you should see the reset password option.      

Windows 10 hangs on Black Screen when logging in

Problem

 Windows 10 hangs on Black Screen when logging in. This normally happends on a normal domain account (but can be any account).

Cause

 Windows 10 Bug

Solution

If on Black screen, press CTRL + ALT + DEL and log out

Sign in with a local admin account

Run Services.msc

Right click App Rediness > Properties

Set startup type to disabled.

Reboot machine and log into effected user.

Once logged in Install all windows updates as this issue was resolved in an anniversary updatre.

Reference, Links and Images

https://h30434.www3.hp.com/t5/Desktop-Boot-and-Lockup/SOLVED-For-everyone-who-is-having-black-screen-after-login/m-p/6319827#M45440 

 

Which switches to use for ROBOCOPY

robocopy "D:\source_folder" "D:\dest_folder" /e /r:5 /w:10 /COPY:DATSOU /LOG:C:\Copyresults.txt

OR

robocopy "\\servername\sharename" "E:\Data Folder\Target Folder" /MIR /W:10 /R:1 /LOG:E:\ROBOCOPY\Copyresults.txt

 

/e

Copies subdirectories. Note that this option includes empty directories.

/r:<N>

Specifies the number of retries on failed copies.

/copy:<CopyFlags>

Specifies the file properties to be copied. The following are the valid values for this option:
D Data
A Attributes
T Time stamps
S NTFS access control list (ACL)
O Owner information
U Auditing information
The default value for CopyFlags is DAT (data, attributes, and time stamps).

/log:<LogFile>

Writes the status output to the log file (overwrites the existing log file).

WSUS Crashing - WSUSPOOL Stopping in IIS

Problem

 WSUS MMC Crashes and WSUS Generally unreliable.

Cause

 Application Pool "WSUSPool" Stopped in IIS

Solution

To improve WSUS availability, you need to increase IIS Private Memory Limit. The default limit is set to 1843200KB. And when an IIS worker process uses more than 2GB WSUS crashes and the problem occurs.

Change Private Memory Limit (KB) to a higher number that fits your server specifications or simply 0 , which means no limit, instead of the hard-coded 1843200. Follow this path to find the setting:

 

WSUS Application Pool IIS Advanced Settings

Internet Information Services (IIS) Manager → Server → Application Pools → Select “WSUSPool” → Actions Advanced → Recycling → change “Private Memory Limit (KB)“.

This’ll improve WSUS availability.