Tips, tricks, and scripts for Admins on the run. Also this serves a a brainless repository for me when I know I'll need it later.
Friday, June 1, 2012
Powershell Community extensions command reference
http://www.codeplex.com/PowerShellCX
How did I get the list below for you?
Get-Command|where {$_.modulename -eq "pscx"}|% {$_.name}
Add-DirectoryLength
Add-PathVariable
Add-ShortPath
call
Clear-MSMQueue
ConvertFrom-Base64
ConvertTo-Base64
ConvertTo-MacOs9LineEnding
ConvertTo-Metric
ConvertTo-UnixLineEnding
ConvertTo-WindowsLineEnding
Convert-Xml
cvxml
Disconnect-TerminalSession
Dismount-VHD
e
Edit-File
Edit-HostProfile
Edit-Profile
ehp
Enable-OpenPowerShellHere
ep
Expand-Archive
Export-Bitmap
fhex
Format-Byte
Format-Hex
Format-Xml
fxml
gcb
Get-ADObject
Get-AdoConnection
Get-AdoDataProvider
Get-AlternateDataStream
Get-Clipboard
Get-DhcpServer
Get-DomainController
Get-DriveInfo
Get-EnvironmentBlock
Get-FileTail
Get-FileVersionInfo
Get-ForegroundWindow
Get-Hash
Get-Help
Get-HttpResource
Get-LoremIpsum
Get-MountPoint
Get-MSMQueue
Get-OpticalDriveInfo
Get-PathVariable
Get-PEHeader
Get-Privilege
Get-PropertyValue
Get-PSSnapinHelp
Get-ReparsePoint
Get-ScreenCss
Get-ScreenHtml
Get-ShortPath
Get-TabExpansion
Get-TerminalSession
Get-TypeName
Get-Uptime
Get-ViewDefinition
gpv
gtn
help
igc
Import-Bitmap
Invoke-AdoCommand
Invoke-Apartment
Invoke-BatchFile
Invoke-Elevated
Invoke-GC
Invoke-Method
Invoke-NullCoalescing
Invoke-Reflector
Invoke-Ternary
Join-String
less
ln
lorem
Mount-VHD
New-Hardlink
New-HashObject
New-Junction
New-MSMQueue
New-Shortcut
New-Symlink
nho
ocb
Out-Clipboard
Out-Speech
Ping-Host
Pop-EnvironmentBlock
Push-EnvironmentBlock
ql
qs
QuoteList
QuoteString
Read-Archive
Receive-MSMQueue
Remove-AlternateDataStream
Remove-MountPoint
Remove-ReparsePoint
Resize-Bitmap
Resolve-ErrorRecord
Resolve-Host
Resolve-HResult
Resolve-WindowsError
rf
rver
rvhr
rvwer
Send-MSMQueue
Send-SmtpMail
Set-BitmapSize
Set-Clipboard
Set-FileTime
Set-ForegroundWindow
Set-LocationEx
Set-PathVariable
Set-Privilege
Set-ReadOnly
Set-VolumeLabel
Set-Writable
Show-Tree
skip
Skip-Object
sls
Split-String
sro
Start-TabExpansion
Stop-RemoteProcess
Stop-TerminalSession
su
swr
tail
Test-AlternateDataStream
Test-Assembly
Test-MSMQueue
Test-Script
Test-UserGroupMembership
Test-Xml
touch
Unblock-File
Write-BZip2
Write-Clipboard
Write-GZip
Write-Tar
Write-Zip
Labels:
commands,
communitiy extensions,
powershell,
PSCX
Wednesday, May 23, 2012
Group Policy Preference and Printers = heartburn
Okay so there is so much that can go wrong when you deploy printers via GPP. So let's take this slow:
Assumptions: clean machine with no drivers
Computer Policy Settings
Admin Templates --> Printers
1. Disable - Point and Print Restrictions
2. Enable - Extend Point and Print connection to search Windows Update
http://technet.microsoft.com/en-us/library/cc754294.aspx
Assumptions: clean machine with no drivers
Computer Policy Settings
Admin Templates --> Printers
1. Disable - Point and Print Restrictions
2. Enable - Extend Point and Print connection to search Windows Update
http://technet.microsoft.com/en-us/library/cc754294.aspx
OABGen encountered error 80040115 or EVENT LOGs 9334/9330
So I had a client who has 2 hub servers and 3 mailbox servers. Exchange is housed in the parent domain and they have a child domain. The complained that the Offline address book was not synchronizing properly since the migration to exchange 2010 occurred from old and dusted groupwise.
Sure there are tons of posts with this specific issue and several blogs say check DNS, addressing issues, registry , etc (source: http://blogs.msdn.com/b/dgoldman/archive/2007/11/15/oab-generation-fails-to-generate-with-errors-9330-and-9334.aspx ).
The event logs on the server generating the OABs in my case were exactly the same messages as the post above; the only thing to note was the, server that was failing, was being referenced was the DC in the child domain. A packet capture I had done initially showed traffic being passed to the correct server. So I went down a rabbit hole that didn't pan out. As it turns out that in other logs the FQDN of this server was referenced but NOT for the OAL gen process. So I appended the child domain name to the DNS suffixes in the order of parent domain, child domain.
Updated the OAB again and successfully resolved the issue.
OABGen encountered error 80040115 while initializing the offline address book generation process. No offline address books have been generated. Check the event log for more information.
- \OABv2
OABGen encountered error 80040115 (internal ID 50004b2) accessing Active Directory
- \OABv2
Monday, May 21, 2012
Thursday, May 17, 2012
Best practices: Virtual Active Directory Domain Controllers
Here's a number of best practices for virtual domain controllers:
- Never, ever snapshot, never pause, and never clone via vmware client
- Educate yourself on your backup solution and it's AD backup capabilities
- Time Sync, is still very important. Insure your host is sync'd or setup external time source
- vmtools client, if stopped/crashed can cause time issues
- Make sure you can restore, not just backup. Backups are useless if you can't restore. The right backup solution will auto-verify the integrity
- Anti-affinity, make sure your DC's don't end up on the same host.
Wednesday, May 16, 2012
Friday, April 27, 2012
Enabling Strict Replication Via ADSI so you don't ever forget
Powershell Baby!
# Get the distinguished name of the Active Directory domain
$DomainDn = ([adsi]"").distinguishedName
# Build distinguished name path of the Operations container
$OperationsPath = "CN=Operations,CN=ForestUpdates,CN=Configuration," + $DomainDn
# Retrieve a reference to the Operations container using the path we just built
$OperationsContainer = [adsi]"LDAP://$OperationsPath"
# Create a new object inside the Operations container using the GUID, of type "container"
$StrictReplicationContainer = $OperationsContainer.Create("Container", "CN=94fdebc6-8eeb-4640-80de-ec52b9ca17fa")
# Commit the new object to the Active Directory database
$StrictReplicationContainer.SetInfo()
# Get the distinguished name of the Active Directory domain
$DomainDn = ([adsi]"").distinguishedName
# Build distinguished name path of the Operations container
$OperationsPath = "CN=Operations,CN=ForestUpdates,CN=Configuration," + $DomainDn
# Retrieve a reference to the Operations container using the path we just built
$OperationsContainer = [adsi]"LDAP://$OperationsPath"
# Create a new object inside the Operations container using the GUID, of type "container"
$StrictReplicationContainer = $OperationsContainer.Create("Container", "CN=94fdebc6-8eeb-4640-80de-ec52b9ca17fa")
# Commit the new object to the Active Directory database
$StrictReplicationContainer.SetInfo()
Subscribe to:
Posts (Atom)