Script – Get HP Serial Numbers

To get a list of HP Serial numers run the following Powershell script. Place the servernames/ipaddresses you want to check in the serverlist parameter.

 

#
# Get HP Serial Numbers from server text file
#
# Written by Bastiaan van Leeuwen
#
# Change $serverlist parameter to the right text file

$serverlist = "d:\script\servers.txt"
$username = Get-Credential domain\user

foreach($server in get-content $serverlist)
{
gwmi win32_systemenclosure -computer "$server" -credential $username –ErrorAction SilentlyContinue | 
select __SERVER,serialnumber
}

 

SCRIPT – Computer Inventory

The Computer Inventory Script enumerates Hardware, OS, System, Processor, Memory, Disk, and Network information and neatly organizes it in an Excel file. I’ve provided Version 2 of the script that allows you to choose a number of computer resources; all computers in the domain, all servers in the domain, computers from a list maintained in a text file, and the ability manually pick a computer. Version 2 of the PowerShell script also allows you to send credential information should you wish to logon the remote computer with an alternative user account. This is helpful for DMZ servers as well as stand alone servers that are not members of your domain.

source: http://www.powershellpro.com/why-i-no-longer-hate-writing-documentation/614/

 

[wpdm_file id=78]

Active Directory Users and Computers Saved Queries

source: http://myitforum.com/cs2/blogs/rcrumbaker/archive/2008/08/07/active-directory-users-and-computers-saved-queries.aspx

Right Click on Saved Queries and Choose New and then Query.

Name the Query accordingly and then click on Define Query…

 

Then Find the Custom Search and click on the Advanced tab.

Paste each of these in the <add criteria from above to this list> area and then click OK.

 

 

Locked Out Users

(&(&(&(&(objectCategory=person)(objectClass=user)(lockoutTime:1.2.840.113556.1.4.804:=4294967295)))))

 

Dial In Access

(&(&(&(&(objectCategory=person)(objectClass=user)(msNPAllowDialin=TRUE)))))

 

Disabled User Accounts

(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=2))

 

No Expiring Accounts

(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=65536))

 

Active Accounts

(&(&(objectCategory=person)(objectClass=user)(!userAccountControl:1.2.840.113556.1.4.803:=2)))

 

Hidden Mailboxes

(&(objectCategory=person)(objectClass=user)(msExchHideFromAddressLists=TRUE))

 

Windows 2000 SP4

(&(&(&(objectCategory=Computer)(operatingSystem=Windows 2000 Professional)(operatingSystemServicePack=Service Pack 4))))

 

Windows XP SP3

(&(&(&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP Professional)(operatingSystemServicePack=Service Pack 3))))))))

 

Vista SP1 Machines

(&(&(&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=Service Pack 1)))))

 

All Workstations

(sAMAccountType=805306369)

 

2003 Servers Non-DCs

(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2003*)))

 

2003 Servers – DCs

(&(&(&(samAccountType=805306369)(primaryGroupID=516)(objectCategory=computer)(operatingSystem=Windows Server 2003*))))

 

Server 2008

(&(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2008*))))

Backup en restore windows FSRM Quotas

To get a list of quota’s in a text file: dirquota q l > all_quotas.txt

To backup the complete quota database first stop the FSRM services, copy the SRM directory and restart the FSRM services. To be able to copy the SRM directory you need rights on the System Volume Information directory.

 

1. Stop the FSRM services

net stop srmSvc
net stop srmReports
net stop quota
net stop Datascrn

2. Copy SRM for the disk you want to a backup folder, or restore them from a backup folder

3. Start the FSRM services

net start Datascrn
net start quota
net start srmReports
net start srmSvc