Skip to content

Commit

Permalink
Merge pull request #25 from exchange12rocks/dev
Browse files Browse the repository at this point in the history
Updates docs, mainly
  • Loading branch information
exchange12rocks authored Jan 16, 2022
2 parents e607edc + f325b5f commit 2a9f636
Show file tree
Hide file tree
Showing 7 changed files with 10,118 additions and 3,234 deletions.
4 changes: 2 additions & 2 deletions Tests/Common.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
BeforeDiscovery {
$ScriptDirectoryPath = $PSScriptRoot
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\src\
Import-Module -Name (Join-Path -Path $ModuleRootPath -ChildPath 'PSGPPreferences.psd1') -Force
. (Join-Path -Path $ModuleRootPath -ChildPath 'src\Definitions\Classes.ps1')
. (Join-Path -Path $ModuleRootPath -ChildPath 'Definitions\Classes.ps1')
}

Describe 'Internal functions' {
Expand Down
8 changes: 4 additions & 4 deletions Tests/Groups.Group.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
BeforeDiscovery {
$ScriptDirectoryPath = $PSScriptRoot
$DataSourcePath = Join-Path -Path $ScriptDirectoryPath -ChildPath 'Data\Groups'
$Set1Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-GroupsOnly-Set-1.xml'
$Set1Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-GroupOnly-Set-1.xml'
[xml]$Set1Data = Get-Content -Path $Set1Path
$Set2Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-GroupsOnly-Set-2.xml'
$Set2Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-GroupOnly-Set-2.xml'
[xml]$Set2Data = Get-Content -Path $Set2Path
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\src\
Import-Module -Name (Join-Path -Path $ModuleRootPath -ChildPath 'PSGPPreferences.psd1') -Force
. (Join-Path -Path $ModuleRootPath -ChildPath 'src\Definitions\Classes.ps1')
. (Join-Path -Path $ModuleRootPath -ChildPath 'Definitions\Classes.ps1')
}

Describe 'Internal functions' {
Expand Down
14 changes: 7 additions & 7 deletions Tests/Groups.User.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
BeforeDiscovery {
$ScriptDirectoryPath = $PSScriptRoot
$DataSourcePath = Join-Path -Path $ScriptDirectoryPath -ChildPath 'Data\Groups'
$Set1Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-UsersOnly-Set-1.xml'
$Set1Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-UserOnly-Set-1.xml'
[xml]$Set1Data = Get-Content -Path $Set1Path
$Set2Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-UsersOnly-Set-2.xml'
$Set2Path = Join-Path -Path $DataSourcePath -ChildPath 'Groups-UserOnly-Set-2.xml'
[xml]$Set2Data = Get-Content -Path $Set2Path
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\
$ModuleRootPath = Join-Path -Path $ScriptDirectoryPath -ChildPath ..\src\
Import-Module -Name (Join-Path -Path $ModuleRootPath -ChildPath 'PSGPPreferences.psd1') -Force
. (Join-Path -Path $ModuleRootPath -ChildPath 'src\Definitions\Classes.ps1')
. (Join-Path -Path $ModuleRootPath -ChildPath 'Definitions\Classes.ps1')
}

Describe 'Internal functions' {
InModuleScope PSGPPreferences {
BeforeAll {
$GPPSectionSet1 = Deserialize-GPPSection -InputObject $Set1Data
$GPPSectionSet2 = Deserialize-GPPSection -InputObject $Set2Data
#$GPPSectionSet2 = Deserialize-GPPSection -InputObject $Set2Data
}

Describe 'UNIT: Get-GPPSectionFilePath' {
Expand All @@ -29,12 +29,12 @@ Describe 'Internal functions' {
}

It 'Esures the function forms a correct path with string values as parameters' {
Get-GPPSectionFilePath -GPOId $GPOId.Guid -Context 'Machine' -Type 'Users' |
Get-GPPSectionFilePath -GPOId $GPOId.Guid -Context 'Machine' -Type 'Groups' |
Should -Be '\\test.example.com\SYSVOL\test.example.com\Policies\{70f86590-588a-4659-8880-3d2374604811}\Machine\Preferences\Groups\Groups.xml'
}

It 'Esures the function forms a correct path with typed values' {
Get-GPPSectionFilePath -GPOId $GPOId -Context ([GPPContext]::Machine) -Type ([GPPType]::Users) |
Get-GPPSectionFilePath -GPOId $GPOId -Context ([GPPContext]::Machine) -Type ([GPPType]::Groups) |
Should -Be '\\test.example.com\SYSVOL\test.example.com\Policies\{70f86590-588a-4659-8880-3d2374604811}\Machine\Preferences\Groups\Groups.xml'
}
}
Expand Down
101 changes: 80 additions & 21 deletions docs/Set-GPPUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,51 @@ Sets properties of a user definition in a specified Group Policy object.

## SYNTAX

### ByGPOIdObjectUserMustChangePassword
```
Set-GPPUser -InputObject <GPPItemUser> -GPOId <Guid> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameObjectUserMustChangePassword
```
Set-GPPUser -InputObject <GPPItemUser> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdObject
```
Set-GPPUser -InputObject <GPPItemUser> -GPOId <Guid> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>]
[-UserMayNotChangePassword <Boolean>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
[-UserMayNotChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameObject
```
Set-GPPUser -InputObject <GPPItemUser> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>]
[-UserMayNotChangePassword <Boolean>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[-UserMayNotChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdItemNameUserMustChangePassword
```
Set-GPPUser -Name <String> -GPOId <Guid> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
```

### ByGPONameItemNameUserMustChangePassword
```
Set-GPPUser -Name <String> -GPOName <String> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
```

Expand All @@ -35,50 +65,79 @@ Set-GPPUser -InputObject <GPPItemUser> -GPOName <String> [-Context <GPPContext>]
Set-GPPUser -Name <String> -GPOId <Guid> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>] [-UserMayNotChangePassword <Boolean>]
[-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameItemName
```
Set-GPPUser -Name <String> -GPOName <String> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>] [-UserMayNotChangePassword <Boolean>]
[-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdItemLiteralNameUserMustChangePassword
```
Set-GPPUser -LiteralName <String> -GPOId <Guid> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
```

### ByGPONameItemLiteralNameUserMustChangePassword
```
Set-GPPUser -LiteralName <String> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdItemLiteralName
```
Set-GPPUser -LiteralName <String> -GPOId <Guid> [-Context <GPPContext>] [-Action <GPPItemUserActionDisplay>]
[-NewName <String>] [-FullName <String>] [-Description <String>] [-AccountDisabled <Boolean>]
[-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>] [-UserMayNotChangePassword <Boolean>]
[-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameItemLiteralName
```
Set-GPPUser -LiteralName <String> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>]
[-UserMayNotChangePassword <Boolean>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
[-UserMayNotChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdItemBuiltInUserUserMustChangePassword
```
Set-GPPUser -BuiltInUser <GPPItemUserSubAuthorityDisplay> -GPOId <Guid> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameItemBuiltInUserUserMustChangePassword
```
Set-GPPUser -BuiltInUser <GPPItemUserSubAuthorityDisplay> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-UserMustChangePassword <Boolean>]
[-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPOIdItemBuiltInUser
```
Set-GPPUser -BuiltInUser <GPPItemUserSubAuthorityDisplay> -GPOId <Guid> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>]
[-UserMayNotChangePassword <Boolean>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
[-UserMayNotChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

### ByGPONameItemBuiltInUser
```
Set-GPPUser -BuiltInUser <GPPItemUserSubAuthorityDisplay> -GPOName <String> [-Context <GPPContext>]
[-Action <GPPItemUserActionDisplay>] [-NewName <String>] [-FullName <String>] [-Description <String>]
[-AccountDisabled <Boolean>] [-AccountExpires <DateTime>] [-PasswordNeverExpires <Boolean>]
[-UserMayNotChangePassword <Boolean>] [-UserMustChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru]
[<CommonParameters>]
[-UserMayNotChangePassword <Boolean>] [-Disable <Boolean>] [-PassThru] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -166,7 +225,7 @@ Allows you to target your user definition to a system built-in user, instead of
```yaml
Type: GPPItemUserSubAuthorityDisplay
Parameter Sets: ByGPOIdItemBuiltInUser, ByGPONameItemBuiltInUser
Parameter Sets: ByGPOIdItemBuiltInUserUserMustChangePassword, ByGPONameItemBuiltInUserUserMustChangePassword, ByGPOIdItemBuiltInUser, ByGPONameItemBuiltInUser
Aliases:
Accepted values: Administrator, Guest

Expand Down Expand Up @@ -243,7 +302,7 @@ Specifies the ID of a GPO in which you want to search for users. It is a name of
```yaml
Type: Guid
Parameter Sets: ByGPOIdObject, ByGPOIdItemName, ByGPOIdItemLiteralName, ByGPOIdItemBuiltInUser
Parameter Sets: ByGPOIdObjectUserMustChangePassword, ByGPOIdObject, ByGPOIdItemNameUserMustChangePassword, ByGPOIdItemName, ByGPOIdItemLiteralNameUserMustChangePassword, ByGPOIdItemLiteralName, ByGPOIdItemBuiltInUserUserMustChangePassword, ByGPOIdItemBuiltInUser
Aliases:

Required: True
Expand All @@ -258,7 +317,7 @@ Specifies the name of a GPO in which you want to search for users.
```yaml
Type: String
Parameter Sets: ByGPONameObject, ByGPONameItemName, ByGPONameItemLiteralName, ByGPONameItemBuiltInUser
Parameter Sets: ByGPONameObjectUserMustChangePassword, ByGPONameObject, ByGPONameItemNameUserMustChangePassword, ByGPONameItemName, ByGPONameItemLiteralNameUserMustChangePassword, ByGPONameItemLiteralName, ByGPONameItemBuiltInUserUserMustChangePassword, ByGPONameItemBuiltInUser
Aliases:

Required: True
Expand All @@ -273,7 +332,7 @@ If you already have a user definition object in memory, which you want to write
```yaml
Type: GPPItemUser
Parameter Sets: ByGPOIdObject, ByGPONameObject
Parameter Sets: ByGPOIdObjectUserMustChangePassword, ByGPONameObjectUserMustChangePassword, ByGPOIdObject, ByGPONameObject
Aliases:

Required: True
Expand All @@ -288,7 +347,7 @@ Specifies the name of a user which you want to change. Does not support wildcard
```yaml
Type: String
Parameter Sets: ByGPOIdItemLiteralName, ByGPONameItemLiteralName
Parameter Sets: ByGPOIdItemLiteralNameUserMustChangePassword, ByGPONameItemLiteralNameUserMustChangePassword, ByGPOIdItemLiteralName, ByGPONameItemLiteralName
Aliases:

Required: True
Expand All @@ -303,7 +362,7 @@ Specifies the name of a user which you want to change. Supports wildcards.
```yaml
Type: String
Parameter Sets: ByGPOIdItemName, ByGPONameItemName
Parameter Sets: ByGPOIdItemNameUserMustChangePassword, ByGPONameItemNameUserMustChangePassword, ByGPOIdItemName, ByGPONameItemName
Aliases:

Required: True
Expand Down Expand Up @@ -348,7 +407,7 @@ Speficies that the password of the target account should not expire.
```yaml
Type: Boolean
Parameter Sets: (All)
Parameter Sets: ByGPOIdObject, ByGPONameObject, ByGPOIdItemName, ByGPONameItemName, ByGPOIdItemLiteralName, ByGPONameItemLiteralName, ByGPOIdItemBuiltInUser, ByGPONameItemBuiltInUser
Aliases:

Required: False
Expand All @@ -363,7 +422,7 @@ Specifies that the target account should not be able to change its password by i
```yaml
Type: Boolean
Parameter Sets: (All)
Parameter Sets: ByGPOIdObject, ByGPONameObject, ByGPOIdItemName, ByGPONameItemName, ByGPOIdItemLiteralName, ByGPONameItemLiteralName, ByGPOIdItemBuiltInUser, ByGPONameItemBuiltInUser
Aliases:

Required: False
Expand All @@ -378,7 +437,7 @@ Specifies that the target account must change its password at the next logon.
```yaml
Type: Boolean
Parameter Sets: (All)
Parameter Sets: ByGPOIdObjectUserMustChangePassword, ByGPONameObjectUserMustChangePassword, ByGPOIdItemNameUserMustChangePassword, ByGPONameItemNameUserMustChangePassword, ByGPOIdItemLiteralNameUserMustChangePassword, ByGPONameItemLiteralNameUserMustChangePassword, ByGPOIdItemBuiltInUserUserMustChangePassword, ByGPONameItemBuiltInUserUserMustChangePassword
Aliases:

Required: False
Expand Down
Loading

0 comments on commit 2a9f636

Please sign in to comment.