Posts

Showing posts from August, 2019

Find who joined a computer to a domain

Find w ho joined a computer to a domain $NoInfo = $null $Offline = $null $List = $null #Get-Content unknowns.txt | foreach { Get-ADComputer -Filter 'OperatingSystem -like "*Windows server*"' -Properties * | foreach { $FQDN = $_.DNSHostName $Path = "\\$FQDN\c`$\Windows\debug\NetSetup.log" if (Test-Connection $FQDN -Count 1 -ErrorAction SilentlyContinue) { if (Test-Path $Path) { write-host "`n`nChecking $FQDN..." $User = ($($(Select-String -Path $Path -Pattern "lpAccount: " -CaseSensitive) -split " ")[3]) $User [array]$List += Write-Output $FQDN";"$User } else {[array]$NoInfo += $FQDN} } else {[array]$Offline += $FQDN} #sleep 5 } $list

Apply once and do not reapply

Apply once and do not reapply: FilterRunOnce which is also associated a unique id. This looks like -          During the first application, the UID will be stored in the registry (User: HKCU\Software\Microsoft\Group Policy\Client\RunOnce Computer: HKLM\Software\Microsoft\Group Policy\Client\RunOnce). At the second application of the GPP, the CSE will check if the key with the UID already exists and if yes, it does not apply the GPP any more. Force Group Policy to Reapply Settings If you want to make sure that security settings in a GPO are applied every time Group Policy is processed, regardless of whether the GPO has changed, there are four Group Policy settings that you should enable. You can find them under Computer Configuration > Administrative Templates > System > Group Policy. Configure security policy processing Configure registry policy processing Configure scripts policy processing Configure IP security policy proc...

Kerberos

Image
There are some general terms that you might not be familiar, so let’s run through them quickly. Principal Names: Kerberos defines two different types of accounts (or Principals). The two different names given to these types of accounts are User Principal Name (UPN), and Service Principal Name (SPN). We would typically relate these two types of principals to Active Directory users and computers. Only user accounts have a UPN defined on their account. When looking at a user account if you click on the Account tab, the UPN is derived from the combining of the two fields listed for “User logon name”. A User Principal Name must be unique across the entire forest otherwise when the KDC goes to look up the Users Account via UPN it will get back more than one account and cause authentication failures for all users that have the same UPN. The UPN of an Active Directory object is an attribute of the object, and can only hold a single value. The attribute name is userPrincipalName. An exa...

Microsoft Blog

https://blogs.technet.microsoft.com/askds/tag/Rob-Greene/ https://blogs.technet.microsoft.com/askds/tag/ad-replication/page/2/

Windows Server Failover Cluster Log

Windows Server Failover Cluster Log Generating the Cluster.log   Get-ClusterLog   =>  The output looks like for all node in the cluster:   The Cluster.log files can be found in the  \cluster\reports  directory (usually c:\windows\cluster\Reports) on each node.  You can use the  –Destination  parameter to cause the files to be copied to a specified directory with the Server’s name The time stamps default to UTC (which some people call GMT) For instance, if you are in that time zone and a problem occurred at 1:38pm (13:38), UTC time stamp in the cluster log would be (21:38) The  –UseLocalTime  parameter for  Get-ClusterLog  causes the cluster.log to write timestamps that are already adjusted for the server’s time zone instead of using UTC Tip:  The sections of the cluster.log are encased in [===   ===], which makes it easy to navigate down the log to each...

Powershell: SNMP CONFIGURATION AND TRAP

SNMP CONFIGURATION Import-Module ServerManager $check = Get-WindowsFeature | Where-Object {$_.Name -eq "SNMP-Services"} If ($check.Installed -ne "True") { Install-WindowsFeature -Name 'SNMP-Service','RSAT-SNMP' } New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\ValidCommunities -Name PUGAZH -Value 8 -PropertyType "Dword" -Force New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers -Name "PUGAZH" -Value 10.10.05.111 -PropertyType "String" -Force New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration -Name PUGAZH -Force New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\SNMP\Parameters\TrapConfiguration\PUGAZH -Name pugazh -Value 10.10.05.111 #Selecting the NIC and adding route based on IP range. $MGMT = Get-NetIPAddress | ?{ $_.AddressFamily -eq "IPv4" -and ($_.IPAddress -match ...
Windows Server 2008: The Definitive Guide by Jonathan Hassell Copyright © 2008 Jonathan Hassell. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or corporate@oreilly.com. Editor: John Osborn Production Editor: Rachel Monaghan Copyeditor: Colleen Gorman Proofreader: Rachel Monaghan Indexer: Lucie Haskins Cover Designer: Karen Montgomery Interior Designer: David Futato Illustrator: Jessamyn Read Printing History: March 2008: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Windows Server 2008: The Definitive Guide, the image of an albatro...