Parameter attributes allow you to control the features/function of a parameter such as making a specific parameter mandatory.
powershellWhen you use Import-Module
, run a command that triggers module auto-loading (PowerShell 3.0+), or run a script or module with a #Requires -Module
directive, Windows PowerShell does not import the newest version of the module. Instead, it imports the newest version of the module that it finds in the first directory in which it finds the module. The order in which it looks for the module is determined by the value of the PSModulePath
environment variable ($env:PSModulePath
).
Over the summer, the PowerShell Access Control module got some DSC resources to help manage security descriptors for for some of the supported object types. The module includes three resources: cAccessControlEntry
, cSecurityDescriptorSddl
, and cSecurityDescriptor
.
When a Composite Configuration is created as an ordinary module, it seems like it behaves like an ordinary Cmdlet. This means, to pass parameters to the composite configuration I had to do:
Node localhost
{
BaseConfig Common -MyParameter "My Parameter Value" {}
}
powershell
dsc
This is a fork of Michal Gajda's PSWindowsUpdate PowerShell module. The original module can be found on the PowerShell Gallery.
windows github powershellThe order of Client Side Extensions are the order you see in the registry, and that is the order you see in my list as well. But, yes normally there is a but as well Smile the first CSE to be applied is {35378EAC-683F-11D2-A89A-00C04FBBCFA2}
, this is the one for Registry/Administrative Templates this also includes if you write an ADMX template on your own, this will be applied first.
function Get-GPClientSideExtensions {
Get-ChildItem "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions" | foreach {
$guid = ($_.Name).Split("\") | Select -Last 1
$props = Get-ItemProperty $_.PSPath
# Guessing CSE name in order (default), ProcessGroupPolicy, ProcessGroupPolicyEx
if ($props.'(default)') {
$description = $props.'(default)'
} elseif ($props.ProcessGroupPolicy) {
$description = $props.ProcessGroupPolicy
} elseif ($props.ProcessGroupPolicyEx) {
$description = $props.ProcessGroupPolicyEx
} elseif ($gpeGuid = "{35378EAC-683F-11D2-A89A-00C04FBBCFA2}") {
$description = "Administrative Templates"
} else {
$description = "Error guessing CSE name"
}
[PSCustomObject] @{
GUID = $guid
Description = $description
}
}
}
active directory
powershell
group policy
Optimising AD inter-site transport settings.
active directory powershellIn powershell:
Get-ChildItem "HKLM:SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\" | Get-ItemPropertyValue -Name Release
microsoft
powershell
.net
You can do this using parameter sets. By putting each parameter in one set and not the other, PowerShell will take care of the rest.
powershellIf you've ever poked around to look at the raw GPO version number, you've probably wondered why is the number so huge and how does it get displayed as a much smaller value when you view the version number using GPMC.
active directory powershell group policy windowsThe solution should retrieve not only direct group membership, but indirect (through group nesting) too. Although the question is plain and simple, the solution is very interesting from various perspectives.
active directory powershell programmingThe cmdlets provided in the AWS Tools for Windows PowerShell provide three ways to express credential information. Some approaches are more secure than others.
security aws powershellThe AWS Tools for PowerShell are a set of PowerShell cmdlets that are built on top of the functionality exposed by the AWS SDK for .NET. The AWS Tools for PowerShell exposes cmdlets to support the same set of services and regions as supported by the SDK. This cmdlet reference covers cmdlets available in both the AWSPowerShell and AWSPowerShell.NetCore modules.
powershell reference awsLibrary of admin scripts for Active Directory.
script active directory windows powershellThis function is a piece of PSWindowsUpdate module to manage Windows Update on a computer system running Windows. Whole module contain set of functions to check, download and install updates from PowerShell.
windows powershell securityMove-ADDirectoryServerOperationMasterRole -Identity “Target-DC” -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator
$Error[0].Exception.GetType().FullName
The pseudo code for doing this is pretty simple:
Active Directory ACE (access control entries) are different from your regular ACEs (for example, NTFS), because they can be used to grant permissions only on specific types of objects, and to propagate only to specific types of child objects. My question is - how do I replicate this in PowerShell?
active directory powershell sysadminThere are well known methods for setting Access Control Entries (ACEs) on Active Directory objects using Powershell, which rely on you knowing the schemaIDGUID of the schema object classes you are working with (e.g. User, Computer, Group). Unless you know your way around AD it’s not always immediately obvious where to find the schemaIDGUIDs that you need. To help you with this, I’ve thrown together a couple of PowerShell snippets.
active directory powershell sysadmin