Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SOWI Administratoren
Scripts
Commits
bba2761e
Commit
bba2761e
authored
1 year ago
by
Saad Chaaban
Browse files
Options
Downloads
Patches
Plain Diff
Update file createComputer_GUI.ps1
parent
fdf29020
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
windows/AD/createComputer_GUI.ps1
+8
-6
8 additions, 6 deletions
windows/AD/createComputer_GUI.ps1
with
8 additions
and
6 deletions
windows/AD/createComputer_GUI.ps1
+
8
−
6
View file @
bba2761e
...
@@ -103,9 +103,9 @@ $cancelBtn = New-Object system.Windows.Forms.Button
...
@@ -103,9 +103,9 @@ $cancelBtn = New-Object system.Windows.Forms.Button
$cancelBtn
.
BackColor
=
"#ffffff"
$cancelBtn
.
BackColor
=
"#ffffff"
$cancelBtn
.
text
=
" Script beenden "
$cancelBtn
.
text
=
" Script beenden "
$cancelBtn
.
AutoSize
=
$true
$cancelBtn
.
AutoSize
=
$true
$cancelBtn
.
location
=
New-Object
System.Drawing.Point
(
360
,
350
)
$cancelBtn
.
location
=
New-Object
System.Drawing.Point
(
360
,
350
)
$cancelBtn
.
Font
=
'Microsoft Sans Serif,10'
$cancelBtn
.
Font
=
'Microsoft Sans Serif,10'
$cancelBtn
.
ForeColor
=
"#000"
$cancelBtn
.
ForeColor
=
"#000"
$cancelBtn
.
DialogResult
=
[
System.Windows.Forms.DialogResult
]::
Cancel
$cancelBtn
.
DialogResult
=
[
System.Windows.Forms.DialogResult
]::
Cancel
$AddADComputerForm
.
CancelButton
=
$cancelBtn
$AddADComputerForm
.
CancelButton
=
$cancelBtn
$AddADComputerForm
.
Controls
.
Add
(
$cancelBtn
)
$AddADComputerForm
.
Controls
.
Add
(
$cancelBtn
)
...
@@ -126,6 +126,7 @@ function enable_confirm
...
@@ -126,6 +126,7 @@ function enable_confirm
}
}
}
}
# Fügt Windows Computer in die Vordefenierten Standardgruppen hinzu
function
Add-StandardGroups
{
function
Add-StandardGroups
{
Write-Host
"
$(
$ComputerName
.
Text
)
$"
Write-Host
"
$(
$ComputerName
.
Text
)
$"
Add-ADGroupMember
grSowiSoftwareFirefoxESR
-members
"
$(
$ComputerName
.
Text
)
$"
Add-ADGroupMember
grSowiSoftwareFirefoxESR
-members
"
$(
$ComputerName
.
Text
)
$"
...
@@ -139,9 +140,6 @@ function Create-Computer {
...
@@ -139,9 +140,6 @@ function Create-Computer {
-SamAccountName
$
(
$ComputerName
.
Text
)
`
-SamAccountName
$
(
$ComputerName
.
Text
)
`
-Path
$
(
$Department_Computer
.
DistinguishedName
[
$Department
.
SelectedIndex-1
])
`
-Path
$
(
$Department_Computer
.
DistinguishedName
[
$Department
.
SelectedIndex-1
])
`
-Description
$
(
$ComputerType
.
Items
[
$ComputerType
.
SelectedIndex
])
-Description
$
(
$ComputerType
.
Items
[
$ComputerType
.
SelectedIndex
])
If
((
$
(
$ComputerName
.
Text
)
-like
"SOWI-R*"
)
-and
(
$ComputerType
.
SelectedIndex
-ne
2
)
-and
(
$ComputerType
.
SelectedIndex
-ne
3
))
{
Add-StandardGroups
}
[
System.Windows.MessageBox
]::
Show
(
@"
[
System.Windows.MessageBox
]::
Show
(
@"
Es wurden folgender Computer angelegt:
Es wurden folgender Computer angelegt:
...
@@ -152,8 +150,12 @@ Bereich: $($Department.Items[$Department.SelectedIndex])
...
@@ -152,8 +150,12 @@ Bereich: $($Department.Items[$Department.SelectedIndex])
Typ:
$(
$ComputerType
.
Items
[
$ComputerType
.
SelectedIndex
]
)
Typ:
$(
$ComputerType
.
Items
[
$ComputerType
.
SelectedIndex
]
)
"@
,
'Info'
)
"@
,
'Info'
)
If
((
$
(
$ComputerName
.
Text
)
-like
"SOWI-R*"
)
-and
(
$ComputerType
.
SelectedIndex
-ne
2
)
-and
(
$ComputerType
.
SelectedIndex
-ne
3
))
{
Add-StandardGroups
}
}
}
catch
{
catch
{
# Gibt die Fehlermeldung aus, sofern es eine gibt.
[
System.Windows.MessageBox
]::
Show
(
@"
[
System.Windows.MessageBox
]::
Show
(
@"
Ein Fehler ist aufgetreten:
Ein Fehler ist aufgetreten:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment