Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable New-ADUser in PROD #9

Open
wants to merge 57 commits into
base: prod
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
dee1fc6
Add script New-ADUser.ps1 #1 @frankkresse
Jul 3, 2018
b40d750
Merge pull request #8 from scriptrunner/master
AchimWieser Jul 3, 2018
2aab5e9
Add script computer with status. #4 @frankkresse
Jul 3, 2018
5669227
Update issue templates Use Case Request
AchimWieser Jul 3, 2018
d511f32
Fix typo in readme.
Jul 3, 2018
9d00894
Update use-case-request.md
frankkresse Jul 4, 2018
d6e3b70
Update use-case-request.md
frankkresse Jul 4, 2018
7a68e3b
New script set ad user expires. #3 @frankkresse
Jul 4, 2018
3f9fb8b
Merge pull request #13 from scriptrunner/master
frankkresse Jul 4, 2018
c7ffce4
Changed Synopsis #15
HeikoBrenn Jun 12, 2019
a7c92f4
Create Test01.ps1
HaraldPfirmann Mar 18, 2020
25eccd3
Merge pull request #17 from scriptrunner/Development
HaraldPfirmann Mar 18, 2020
15f73d7
Create SRScript01.ps1
HaraldPfirmann Mar 18, 2020
65f6e94
Merge pull request #18 from scriptrunner/Development
HaraldPfirmann Mar 18, 2020
a68729d
Create test02.ps1
HaraldPfirmann Mar 19, 2020
2ea95fb
Create test.txt
HaraldPfirmann Mar 19, 2020
8bd11a2
Merge pull request #19 from scriptrunner/Development
HaraldPfirmann Mar 19, 2020
f8e202b
Test
HaraldPfirmann Mar 25, 2020
d29161e
none
HaraldPfirmann Mar 25, 2020
5bdc34a
message
HaraldPfirmann Mar 25, 2020
f2f661c
none
HaraldPfirmann Mar 25, 2020
8bcd369
Merge branch 'Development' into test
HaraldPfirmann Mar 25, 2020
10ca29e
oo
HaraldPfirmann Mar 25, 2020
15bb5d7
test
HaraldPfirmann Mar 25, 2020
c8c3c1d
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
b3e8c18
neue änderung
HaraldPfirmann Mar 26, 2020
5040f02
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
e480fcb
Habe ich heute geändert
HaraldPfirmann Mar 26, 2020
d2a66dc
Merge branch 'test' of https://github.com/scriptrunner/teamdev into D…
HaraldPfirmann Mar 26, 2020
acd8bcb
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
0ecac69
test
HaraldPfirmann Mar 26, 2020
7e0e260
test
HaraldPfirmann Mar 26, 2020
6e27080
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
86c4157
test
HaraldPfirmann Mar 26, 2020
f0f263a
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
f59bfd6
new
HaraldPfirmann Mar 26, 2020
3b80a7f
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
b4fdb8c
eee
HaraldPfirmann Mar 26, 2020
1d249f6
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
93191d4
ttt
HaraldPfirmann Mar 26, 2020
9515efe
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
3cd439c
test
HaraldPfirmann Mar 26, 2020
5447d97
Merge branch 'Development' into test
HaraldPfirmann Mar 26, 2020
4f2113f
st1
HaraldPfirmann Mar 26, 2020
7a35f6a
ss
HaraldPfirmann Mar 27, 2020
e7aab9b
test the best
HaraldPfirmann Mar 26, 2020
580c029
test71
HaraldPfirmann Aug 20, 2020
1a132aa
test the best
HaraldPfirmann Mar 26, 2020
18e5c52
test71a
HaraldPfirmann Aug 20, 2020
b2cce89
Merge commit '580c029e748281e996ec7f187312e0a5f2c43657' into test
HaraldPfirmann Aug 20, 2020
33f4c81
test3
HaraldPfirmann Aug 20, 2020
69d6ab3
test3
HaraldPfirmann Aug 20, 2020
ca28b09
Test
HaraldPfirmann Apr 8, 2021
d859585
Check
HaraldPfirmann Apr 8, 2021
f02e7f9
weitere Aus´gabe
HaraldPfirmann Jul 14, 2021
32b94ee
erneuert
HaraldPfirmann Jul 19, 2021
a379bdd
Merge commit '32b94ee406b187ff1e7fd015fc6748a9f0ad0176' into test
HaraldPfirmann Jul 19, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/use-case-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Use Case Request
about: Eine neue Aktion/Anwendungsfall zur Umsetzung mit ScriptRunner beauftragen.

---

**Primäre Anwendergruppe**
An welche Anwendergruppe soll die Aktion delegiert werden?
- [ ] Help Desk / Service Hotline / First-Level-Support
- [ ] Second-Level-Support
- [ ] Fachbereich
- [ ] Endbenutzer
- [ ] Administratoren

**Kurzbeschreibung**
Eine kurze Erläuterung des gewünschten Anwendungsfalls.

**Skriptparameter**
Eine Auflistung, der erforderlichen Skriptparameter inkl. Beschreibung und Typ.

**Zielsysteme und Credentials**
Auf welchen Zielsystemen und mit welchen Credentials soll der Anwendungsfall ausgeführt werden?

**Voraussetzungen**
Voraussetzungen auf dem Zielsystem / Credentials / Infrastruktur / etc.

**Screenshots**
Screenshots, die helfen den Anwendungsfall genauer zu Beschreiben.

**Weitere Anmerkungen**
148 changes: 148 additions & 0 deletions ActiveDirectory/Computer/Get-ADComputersWithDefinedStatus.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
#Requires -Version 4.0
#Requires -Modules ActiveDirectory

<#
.SYNOPSIS
Lists computers where disabled or inactive(2)

.DESCRIPTION

.NOTES
This PowerShell script was developed and optimized for ScriptRunner. The use of the scripts requires ScriptRunner.
The customer or user is authorized to copy the script from the repository and use them in ScriptRunner.
The terms of use for ScriptRunner do not apply to this script. In particular, AppSphere AG assumes no liability for the function,
the use and the consequences of the use of this freely available script.
PowerShell is a product of Microsoft Corporation. ScriptRunner is a product of AppSphere AG.
© AppSphere AG

.COMPONENT
Requires Module ActiveDirectory

.LINK
https://github.com/scriptrunner/ActionPacks/tree/master/ActiveDirectory/Computers

.Parameter OUPath
Specifies the AD path

.Parameter DomainAccount
Active Directory Credential for remote execution on jumphost without CredSSP

.Parameter Disabled
Shows the disabled computers

.Parameter InActive
Shows the inactive computers

.Parameter DomainName
Name of Active Directory Domain

.Parameter SearchScope
Specifies the scope of an Active Directory search

.Parameter AuthType
Specifies the authentication method to use
#>

param(
[Parameter(Mandatory = $true,ParameterSetName = "Local or Remote DC")]
[Parameter(Mandatory = $true,ParameterSetName = "Remote Jumphost")]
[string]$OUPath,
[Parameter(ParameterSetName = "Local or Remote DC")]
[Parameter(ParameterSetName = "Remote Jumphost")]
[switch]$Disabled,
[Parameter(ParameterSetName = "Local or Remote DC")]
[Parameter(ParameterSetName = "Remote Jumphost")]
[switch]$InActive,
[Parameter(Mandatory = $true,ParameterSetName = "Remote Jumphost")]
[PSCredential]$DomainAccount,
[Parameter(ParameterSetName = "Local or Remote DC")]
[Parameter(ParameterSetName = "Remote Jumphost")]
[string]$DomainName,
[Parameter(ParameterSetName = "Local or Remote DC")]
[Parameter(ParameterSetName = "Remote Jumphost")]
[ValidateSet('Base','OneLevel','SubTree')]
[string]$SearchScope='SubTree',
[Parameter(ParameterSetName = "Local or Remote DC")]
[Parameter(ParameterSetName = "Remote Jumphost")]
[ValidateSet('Basic', 'Negotiate')]
[string]$AuthType="Negotiate"
)

Import-Module ActiveDirectory

#Clear
#$ErrorActionPreference='Stop'
try{
$resultMessage = @()
if($PSCmdlet.ParameterSetName -eq "Remote Jumphost"){
if([System.String]::IsNullOrWhiteSpace($DomainName)){
$Domain = Get-ADDomain -Current LocalComputer -AuthType $AuthType -Credential $DomainAccount -ErrorAction Stop
}
else{
$Domain = Get-ADDomain -Identity $DomainName -AuthType $AuthType -Credential $DomainAccount -ErrorAction Stop
}
if([System.String]::IsNullOrWhiteSpace($OUPath)){
$OUPath = $Domain.DistinguishedName
}
if($Disabled -eq $true){
$computers = Search-ADAccount -Credential $DomainAccount -Server $Domain.PDCEmulator -AuthType $AuthType -AccountDisabled -ComputersOnly `
-SearchBase $OUPath -SearchScope $SearchScope | Select-Object DistinguishedName, SAMAccountName | Sort-Object -Property SAMAccountName
if($computers){
foreach($itm in $computers){
$resultMessage = $resultMessage + ("Disabled: " + $itm.DistinguishedName + ';' +$itm.SamAccountName)
}
$resultMessage = $resultMessage + ''
}
}
if($InActive -eq $true){
$computers = Search-ADAccount -Credential $DomainAccount -Server $Domain.PDCEmulator -AuthType $AuthType -AccountInactive -ComputersOnly `
-SearchBase $OUPath -SearchScope $SearchScope | Select-Object DistinguishedName, SAMAccountName | Sort-Object -Property SAMAccountName
if($computers){
foreach($itm in $computers){
$resultMessage = $resultMessage + ("Inactive: " + $itm.DistinguishedName + ';' +$itm.SamAccountName)
}
}
}
}
else{
if([System.String]::IsNullOrWhiteSpace($DomainName)){
$Domain = Get-ADDomain -Current LocalComputer -AuthType $AuthType -ErrorAction Stop
}
else{
$Domain = Get-ADDomain -Identity $DomainName -AuthType $AuthType -ErrorAction Stop
}
if([System.String]::IsNullOrWhiteSpace($OUPath)){
$OUPath = $Domain.DistinguishedName
}
if($Disabled -eq $true){
$computers = Search-ADAccount -Server $Domain.PDCEmulator -AuthType $AuthType -AccountDisabled -ComputersOnly `
-SearchBase $OUPath -SearchScope $SearchScope | Select-Object DistinguishedName, SAMAccountName | Sort-Object -Property SAMAccountName
if($computers){
foreach($itm in $computers){
$resultMessage = $resultMessage + ("Disabled: " + $itm.DistinguishedName + ';' +$itm.SamAccountName)
}
$resultMessage = $resultMessage + ''
}
}
if($InActive -eq $true){
$computers = Search-ADAccount -Server $Domain.PDCEmulator -AuthType $AuthType -AccountInactive -ComputersOnly `
-SearchBase $OUPath -SearchScope $SearchScope | Select-Object DistinguishedName, SAMAccountName | Sort-Object -Property SAMAccountName
if($computers){
foreach($itm in $computers){
$resultMessage = $resultMessage + ("Inactive: " + $itm.DistinguishedName + ';' +$itm.SamAccountName)
}
}
}
}
if($SRXEnv) {
$SRXEnv.ResultMessage = $resultMessage
}
else{
Write-Output $resultMessage
}
}
catch{
throw
}
finally{
}
Loading