Wednesday, July 29, 2015
Creating Keytab for UNIX machines access in Active Directory
Tuesday, July 28, 2015
Microsoft Cluster - Disco reserved
Microsoft Windows [Version 6.1.7601]Copyright (c) 2009 Microsoft Corporation. All rights reserved.C: \ Users \ Admin> diskpartMicrosoft DiskPart version 6.1.7601Copyright (C) 1999-2008 Microsoft Corporation.On computer: VMTESTECLUSTER01DISKPART> list diskDisk ### Status Size Free Dyn Gpt--- ----- --- --- - -Disk 0 Online 100 GB 1024 KBDisk 1 Online 80 GB 1024 KBDisk 2 Online 600 GB 0 BDisk 3 Online 600 GB 0 BDisk 4 Online 600 GB 0 BDISKPART> select disk 1Disk 1 is now the selected disk.DISKPART> detail diskVMware Virtual Disk SCSI Disk DeviceDisk ID: E87C0E42Type: SASStatus: OnlinePath: 0Target: 1LUN ID: 0Location Path: PCIROOT (0) #PCI (1500) #PCI (0000) #SAS (P00T01L00)Current read-only state: NoRead-only: NoBoot Disk: NoPagefile Disk OnHibernation File Disk OnCrashdump Disk OnClustered Disk OnVolume ### Ltr Label Fs Type Size Status Info---- - ---- - ---- --- --- ---Volume 3 D New Volume NTFS Partition 79 GB HealthyDISKPART>Microsoft Windows [Version 6.1.7601]Copyright (c) 2009 Microsoft Corporation. All rights reserved.C: \ Users \ Admin> diskpartMicrosoft DiskPart version 6.1.7601Copyright (C) 1999-2008 Microsoft Corporation.On computer: VMTESTECLUSTER02DISKPART> list diskDisk ### Status Size Free Dyn Gpt--- ----- --- --- - -Disk 0 Online 100 GB 1024 KBDisk 1 Online 80 GB 1024 KBDisk 2 Online 600 GB 0 BDisk 3 Online 600 GB 0 BDisk 4 Online 600 GB 0 BDISKPART> select disk 1Disk 1 is now the selected disk.DISKPART> detail diskVMware Virtual Disk SCSI Disk DeviceDisk ID: E87C0E42Type: SASStatus: OnlinePath: 0Target: 1LUN ID: 0Location Path: PCIROOT (0) #PCI (1500) #PCI (0000) #SAS (P00T01L00)Current read-only state: NoRead-only: NoBoot Disk: NoPagefile Disk OnHibernation File Disk OnCrashdump Disk OnClustered Disk OnVolume ### Ltr Label Fs Type Size Status Info---- - ---- - ---- --- --- ---Volume 3 D NTFS Partition 79 GB HealthyDISKPART>
Clear-ClusterDiskReservation -Disk 1 -node node1 -Force
Number of active users in AD
(Get-ADUser -filter * | where {$ _. Enabled -eq "True"}). Count
List Domain Group Members
AllGroups = $ @ ()
$ MyGroups = Get-ADGROUP -filter {GroupCategory -eq "Security"} -SearchBase "dc = DOMAIN, DC = LOCAL" -Properties Name, Member | select Name, Member
foreach ($ Group in $ MyGroups) {
$ GroupInfo.'Group Name '= $ Group.Name
$ GroupInfo.'Group Description '= $ Group.Description
foreach ($ Member in $ Group.Member) {
$ User = Get-Member ADUser $ -Properties Name | select Name
$ GroupInfo.'Member Name '= $ User.Name
$ Groupinfo | select 'Group Name', 'Member Name'
$ AllGroups + = $ groupinfo | Select 'Group Name', 'Member Name'
}
}
Set-ExecutionPolicy: Can not set execution policy
. \ UpdateIndexAllMailboxDatabases.ps1: File C: \ Temp \ SCRIPTS \ EXCHANGE \UpdateIndexAllMailboxDatabases.ps1 can not be loaded. The file C: \ Temp \ SCRIPTS \ EXCHANGE \UpdateIndexAllMailboxDatabases.ps1 is not digitally signed. The script will not execute on the system. Please see "get-help about_signing" for more details ..
At line: 1 char: 37
Execution Policy Change
The execution policy helps protect you from scripts That You do not trust. Changing the execution policy might expose you to the security risks described in the help topic at about_Execution_Policies
http://go.microsoft.com/fwlink/?LinkID=135170 . Do you want to change the execution policy?
[Y] Yes [N] No [S] Suspend Help (default is "Y") [?] Y
Set-ExecutionPolicy: Windows PowerShell execution policy successfully updated your, but the setting is overridden by
the policy defined at a more specific scope. Due to the override, your shell will retain its current effective
execution of policy RemoteSigned. Type "Get-ExecutionPolicy -List" to view your execution policy settings.For more
information please see "Get-Help Set-ExecutionPolicy".
At line: 1 char: 1
+ Set-ExecutionPolicy Unrestricted
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo: PermissionDenied: (:) [Set-ExecutionPolicy] SecurityException
+ FullyQualifiedErrorId: ExecutionPolicyOverride, Microsoft.PowerShell.Commands.SetExecutionPolicyCommand
Get-ExecutionPolicy -ListScope ExecutionPolicy
- -----
MachinePolicy RemoteSigned
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
Set-ExecutionPolicy: Can not set execution policy. Execution policies at the MachinePolicy or UserPolicy scopes must beset through Group Policy.
Get-ExecutionPolicy -ListScope ExecutionPolicy
- -----
MachinePolicy Bypass
UserPolicy Undefined
Process Undefined
CurrentUser Undefined
LocalMachine RemoteSigned
Verifying GPO Replication
function Get-ADGPOReplication
{
<#
.SYNOPSIS
This function retrieve one or all the GPO and Their report DSVersions and SysVolVersions (Users and Computers)
.DESCRIPTION
This function retrieve one or all the GPO and Their report DSVersions and SysVolVersions (Users and Computers)
.PARAMETER GPOName
Specify the name of the GPO
All .PARAMETER
Specify That You want to retrieve all the GPO (slow if you have a lot of Domain Controllers)
.EXAMPLE
Get-ADGPOReplication -GPOName "Default Domain Policy"
.EXAMPLE
Get-ADGPOReplication -All
.NOTES
Francois-Xavier Cat
lazywinadm
lazywinadmin.comVERSION HISTORY
1.0 22/09/2014 Initial version
Adding some more Error Handling
Fix some typo
#>
#requires -version 3
[CmdletBinding ()]
PARAM (
[Parameter (Mandatory = $ True, ParameterSetName = "One")]
[String []] $ GPOName,
[Parameter (Mandatory = $ True, ParameterSetName = "All")]
[Switch] $ All
)
BEGIN
{
TRY
{
if (-not (Get-Module ActiveDirectory -Name)) {Import-Module ActiveDirectory -Name -ErrorAction Stop -ErrorVariable ErrorBeginIpmoAD}
if (-not (Get-Module -Name GroupPolicy)) {Import-Module -Name GroupPolicy -ErrorAction Stop -ErrorVariable ErrorBeginIpmoGP}
}
CATCH
{
Write-Warning -Message "[BEGIN] Something wrong happened"
IF ($ ErrorBeginIpmoAD) {Write-Warning -Message "[BEGIN] Error while Importing the module Active Directory"}
IF ($ ErrorBeginIpmoGP) {Write-Warning -Message "[BEGIN] Error while Importing the module Group Policy"}
Write-Warning -Message "[BEGIN] $ ($ Error [0] .exception.message)"
}
}
PROCESS
{
FOREACH ($ DomainController in ((Get-ADDomainController -ErrorAction Stop -ErrorVariable ErrorProcessGetDC -filter *). Hostname))
{
TRY
{
IF ($ psBoundParameters ['GPOName'])
{
Foreach ($ GPOItem in $ GPOName)
{
$ GPO = Get-GPO -Name $ GPOItem -Server $ DomainController -ErrorAction Stop -ErrorVariable ErrorProcessGetGPO[PSCustomObject] [ordered] {@
GroupPolicyName = $ GPOItem
DomainController = $ DomainController
UserVersion = $ GPO.User.DSVersion
UserSysVolVersion = $ GPO.User.SysvolVersion
ComputerVersion = $ GPO.Computer.DSVersion
ComputerSysVolVersion = $ GPO.Computer.SysvolVersion
} #PSObject
} #Foreach ($ GPOItem in $ GPOName)
} #IF ($ PsBoundParameters ['GPOName'])
IF ($ psBoundParameters ['All'])
{
$ GPOList = Get-GPO -All -Server $ DomainController -ErrorAction Stop -ErrorVariable ErrorProcessGetGPOAllforeach ($ GPO in $ GPOList)
{
[PSCustomObject] [ordered] {@
GroupPolicyName = $ GPO.DisplayName
DomainController = $ DomainController
UserVersion = $ GPO.User.DSVersion
UserSysVolVersion = $ GPO.User.SysvolVersion
ComputerVersion = $ GPO.Computer.DSVersion
ComputerSysVolVersion = $ GPO.Computer.SysvolVersion
} #PSObject
}
} #IF ($ PsBoundParameters ['All'])
} #TRY
CATCH
{
Write-Warning -Message "[PROCESS] Something wrong happened"
IF ($ ErrorProcessGetDC) {Write-Warning -Message "[PROCESS] Error while running retrieving Domain Controllers with Get-ADDomainController"}
IF ($ ErrorProcessGetGPO) {Write-Warning -Message "[PROCESS] Error while running Get-GPO"}
IF ($ ErrorProcessGetGPOAll) {Write-Warning -Message "[PROCESS] Error while running Get-GPO -All"}
Write-Warning -Message "[PROCESS] $ ($ Error [0] .exception.message)"
}
} #FOREACH
} #PROCESS
}
- Create a .ps1 file containing the code above, or download it here
- Run the script in PS ISE as administrator
- Run the function !!
Saved Queries
Active Directory Queries!!!!!!
Find Groups that contains the word admin
(objectcategory=person)(description=*admin*)
(groupType:1.2.840.113556.1.4.803:=8)
(objectCategory=group)(!member=*)
Finds all groups defined as a Global Group, a Domain Local Group, or a Universal Group
(groupType:1.2.840.113556.1.4.804:=14)
(objectcategory=person)(samaccountname=*Bob*)
(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=65536)
(&(&(objectCategory=person)(objectClass=user))(|(lastLogon=0)(!(lastLogon=*))))
(objectcategory=person)(!scriptPath=*)
(objectcategory=person)(!profilepath=*)
(objectCategory=person)(objectClass=user)(pwdLastSet=0)(!useraccountcontrol:1.2.840.113556.1.4.803:=2)
(objectCategory=person)(objectClass=user)(!useraccountcontrol:1.2.840.113556.1.4.803:=2)
(objectCategory=person)(objectClass=user)(useraccountcontrol:1.2.840.113556.1.4.803:=16)
(groupType:1.2.840.113556.1.4.803:=4)
(objectcategory=person)(mail=*)
(objectcategory=person)(!mail=*)
(|(objectcategory=user)(objectcategory=group)(objectcategory=contact))(|(description=North*)(company=Contractors*))
(objectcategory=user)(|(mobile=712*)(mobile=155*))
(objectCategory=user)(msNPAllowDialin=TRUE)
Note: server name must be changed
(&(&(&(uncName=*Servername*)(objectCategory=printQueue)(printColor=TRUE))))
(&(&(&objectCategory=user)(mDBUseDefaults=FALSE)))
(&(objectCategory=user)(pwdLastSet=0))
Notice the “>=” that means “Greater than or equal to”.
(objectCategory=user)(badPwdCount>=2)
(objectCategory=computer)(!description=*)
(&(objectCategory=person)(objectClass=user)(msExchHideFromAddressLists=TRUE))
(&(&(&(objectCategory=Computer)(operatingSystem=Windows 2000 Professional)(operatingSystemServicePack=Service Pack 4))))
(&(&(&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP Professional)(operatingSystemServicePack=Service Pack 2))))))))
(&(&(&(&(&(&(&(objectCategory=Computer)(operatingSystem=Windows XP Professional)(operatingSystemServicePack=Service Pack 3))))))))
(&(&(&(&(sAMAccountType=805306369)(objectCategory=computer)(operatingSystem=Windows Vista*)(operatingSystemServicePack=Service Pack 1)))))
(sAMAccountType=805306369)
(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2003*)))
(&(&(&(samAccountType=805306369)(primaryGroupID=516)(objectCategory=computer)(operatingSystem=Windows Server 2003*))))
(&(&(&(&(samAccountType=805306369)(!(primaryGroupId=516)))(objectCategory=computer)(operatingSystem=Windows Server 2008*))))
Wednesday, February 1, 2012
Default permissions of the Sysvol folder
They follow a standard NTFS permissions of the SYSVOL folder:
% SystemRoot% \ Windows \ Sysvol
- Clear the Allow inheritable permissions from parent to propagate to this object check box
- Administrators: Full Control
- Authenticated Users: Read, Read & Execute, List Folder Contents and
- Creator Owner: Nothing selected
- Server Operators: Read, Read & Execute, List Folder Contents and
- System: Full Control
% SystemRoot% \ Windows \ Sysvol \ Sysvol
- Clear the Allow inheritable permissions from parent to propagate to this object check box
% SystemRoot% \ Winnt \ Sysvol \ Sysvol \ domain
- Clear the Allow inheritable permissions from parent to propagate to this object check box
% SystemRoot% \ Winnt \ Sysvol \ Sysvol \ domain \ Policies
- Clear the Allow inheritable permissions from parent to propagate to this object check box
- Administrators: Full Control
- Authenticated Users: Read, Read & Execute, List Folder Contents and
- Creator Owner: Nothing selected
- Group Policy Creator Owners: Read, Read & Execute, List Folder Contents, Modify, and Write
- Server Operators: Read, Read & Execute, List Folder Contents and
- System: Full Control
For each file or folder that is located in the% SystemRoot% \ Winnt \ Sysvol \ Sysvol \ domain \ Policies
- Check the Allow inheritable permissions from parent to propagate to this object check box
Sysvol share permissions:
- Administrators: Full Control
- Authenticated Users: Full Control
- Everyone: Read
Reference: http://truetechsolutions.supersized.org/archives/8-Default-Permissions-for-Sysvol.html
MSExchange ADAccess 2114
In a recent project, I experienced a problem (at least by the messages on the Installation Wizard on eSales and Viewer - see image below).. This problem occurred (at least in my case) the installation of the Hub-Transport. Below is the message displayed EventViewer ...
MSEXCHANGEADTOPOLOGYSERVICE.EXE Process (PID = 1256). Topology discovery failed, error 0x80040a02 (DSC_E_NO_SUITABLE_CDC). Look up the Lightweight Directory Access Protocol (LDAP) error code specified in the event description. To this, use Microsoft Knowledge Base article 218185, "Microsoft LDAP Error Codes." Use the information in That article to learn more about the cause and resolution to this error. Use the Ping or PathPing command-line tools to test network connectivity to local domain controllers.
... Such an error occurs in Exchange Server 2007.2010. The resolution is put to the same Exchange server account in the Domain Admin group. After inclusion of the server group, restart the server and reinstall Exchange (if the problem has been presented in time of installation.).
Also spent a similar problem with Exchange Server 2003 ... in this case, the situation was regarding the deletion of an account of the Exchange server object AD.A restoration was carried out via ADRESTORE and even after inclusion of the restored object in the security groups required for Exchange Server Exchange services failed to initialize ....
Appears in the Event Viewer event ID 2114 MSExchange DSAccess.
In this case, I performed the following procedures:
- After the deletion of the object, restore the same with ADRESTORE;
- Add in the server security groups required (in some cases, these steps alone are enough to return to normal services);
- Remove the network cable from the Exchange server;
- Place the Exchange server in Workgroup and restart the server, without attaching the network cable;
- In AD, reset the account of the Exchange server;
- Plug the cable into the Exchange server and put it back in the field;
- Restart the server;
After these procedures, the services back to work!
Another very common procedure for troubleshooting permissions on an Exchange organization, and runs the setup / domainprep command again in DC.
Hope that helps!
Wallpaper does not load in Windows 7 via GPO
A known bug in Windows 7 and Windows Server 2008 R2 is for the loading of the wallpaper, when it is configured via GPO.
To solve the problem, we can take the following actions:
- Enter the machine's registry ( http://en.kioskea.net/faq/589-how-to-open-registry )
- Navigate to the following key:
- HKEY_CURRENT_USER \ Control Panel \ Desktop
- Find the REG_SZ value called Wallpaper
- Change the value with the path where the wallpaper is shared.
You can download a fix that will make the change:
If necessary change on multiple workstations, we can effect such change through thePreferences via GPO. As the image below:
If your domain is Windows Server 2003 and either does not support the Preferences feature, you need the distribution via script to make the change key in the registry.
The following example:
Const HKEY_CURRENT_USER = & H80000001
strComputer = "."
Set oReg = GetObject ("winmgmts: {ImpersonationLevel = impersonate}! \ \" & _
strComputer & "\ root \ default: StdRegProv")
strKeyPath = "Control Panel \ Desktop"
strValueName = "Wallpaper"
strValue = "\ \ server \ share \ wallpaper.jpg"
oReg.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strValue
Migrate Server Roles to Windows Server 2008 R2
Below is a URL that I think is very interesting, especially for computer consultants, where deployments and migrations are part of the day is dia.Trata tutorials migration of server roles in Windows Server 2003 and Windows Server 2008 to Windows Server 2008 R2.
http://technet.microsoft.com/en-us/library/dd365353 (WS.10). aspx
Monday, March 28, 2011
0 × 00000024 (Kaspersky 0x001904AA ...
I had an experience at least annoying with Windows Server 2008 and Kaspersky antivirus, the research I did, the same problem occurs with Windows Vista.
The symptom is continuous reboot server.The server boots into SAFE MODE normally, but in normal mode remains at the logon screen for some time and the system reboots after showing a blue screen.
The error code shown on the blue screen 0 × 00000024 (0x001904AA ...(the rest of the code may vary).
The solution to the problem was removing the Kaspersky antivirus from the server, using the procedures listed in the following sitehttp://hubpages.com/hub/How-to-uninstall-or-remove-Kaspersky-totally
Another method I found but have not tested, is to rename or delete the file% windir% \ system32 \ drivers \ klif.sys in SAFE MODE and reboot the server.
I hope this is helpful!
Sunday, June 27, 2010
GPO Search
Ladies and gentlemen!
I've been googling and found a very cool application provided by our Windows Azure … it is a website where we can search GPO and registry settings!! Pretty cool, what's more we have provider for IE 7 and 8.
Quick video showing the Following uses of the site ...
Thursday, December 3, 2009
How to reset the restore mode password in Active Directory
In this article, let's resetting a password is commendable in a domain environment at Microsoft, the password used in "directory services Restore mode" which is requested at the time of promoting a server to domain controller during DCPROMO proccess. This password will be used when there is a nessecidade to perform an offline maintenance on the Active Directory data, e.g. a authoritative restore.
There is an aggravating circumstance, mainly in the exchange network administrators, which is not very important documentation this password, which makes offline AD maintenance. To work around this problem, we can reset the password of Restore Mode by doing the following:
At the DOS prompt, run the NTDSUTIL utility, as pictured below …
At the NTDSUTIL prompt, type set dsrm password, to sign in DSRM utility that will reset the password.
If you are running these procedures on the server you want to reset the password, type reset password on server null hit enter and type and confirm a new password of "directory services Restore mode" … if you want the command to be executed on a remote server, type reset password on server <ServerName> reminding you that the password must meet complexity …
After these procedures, type q to exit the DSRM prompt and q again to quit the NTDSUTIL prompt
Now just restart the server and pressing the F8 key to use the "directory services Restore mode" , and good luck in your AD maintenance …

