-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet-LinuxComputerDomainPrefs.ps1
78 lines (48 loc) · 1.62 KB
/
Set-LinuxComputerDomainPrefs.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/env powershell
Function Set-LinuxComputerDomainPrefs{
<#
.SYNOPSIS
Describe purpose of "Set-LinuxComputerDomainPrefs" in 1-2 sentences.
.DESCRIPTION
Add a more complete description of what the function does.
.PARAMETER DomainName
Describe parameter -DomainName.
.PARAMETER ADgroup
Describe parameter -ADgroup.
.PARAMETER DomainAlias
Describe parameter -DomainAlias.
.EXAMPLE
Set-LinuxComputerDomainPrefs -DomainName Value -ADgroup Value -DomainAlias Value
Describe what this call does
.NOTES
Place additional notes here.
.LINK
URLs to related sites
The first link is opened by Get-Help -Online Set-LinuxComputerDomainPrefs
.INPUTS
List of input types that are accepted by this function.
.OUTPUTS
List of output types produced by this function.
#>
[CmdletBinding()]
Param (
[string]$DomainName,
[string[]]$ADgroup,
[string]$DomainAlias
)
Begin {}
Process {
if ($islinux) {
#Edit /opt/pbis/bin/config - basic settings for AD user experience PowerBroker ID Services
/opt/pbis/bin/config UserDomainPrefix $DomainName
/opt/pbis/bin/config AssumeDefaultDomain True
/opt/pbis/bin/config HomeDirTemplate %H/%D/%U
#Add AD groups to Sudoers
foreach ($group in $ADgroup) {
#Add-Content -Path '/etc/sudoers' -Value "%$DomainAlias\\$group ALL=(ALL) ALL" -append
"%$DomainAlias\\$group ALL=(ALL) ALL" | Out-File -path '/etc/sudoers' -Append
}
}
}
End {}
}