Mainos / Advertisement:

Ero sivun ”Powershellscript” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
Rivi 23: Rivi 23:
 
=== käyttäjiä ===
 
=== käyttäjiä ===
  
New-ADUser -Name uuser -HomeDirectory "\\Wcore\home\%username%" -HomeDrive "K:" -Enabled $true -PasswordNotRequired $true -AccountPassword (Read-Host -AsSecureString "AccountPassword")
+
New-ADUser -Name uuser -HomeDirectory "\\Wcore\home\%username%" -HomeDrive "K:" -Enabled $true -PasswordNotRequired $true -AccountPassword (Read-Host -AsSecureString "AccountPassword")
 +
 
 +
 
 +
New-ADOrganizationalUnit -Name "taitaja2"
 +
New-ADGroup -Name "kayttajat" -GroupScope Global -Path "ou=taitaja2,dc=core,dc=local"
 +
New-ADGroup -Name "koneet" -GroupScope Global -Path "ou=taitaja2,dc=core,dc=local"
 +
New-ADUser -Name "hermanni1" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true
 +
New-ADUser -Name "hermanni2" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true
 +
New-ADUser -Name "hermanni3" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true

Versio 30. tammikuuta 2015 kello 14.43

Powershellillä voi tehä kaikkee kivaa

Import-Module NetAdapter
$netadapter = Get-Netadapter -Name Ethernet
$netadapter | Set-NetIPInterface -DHCP Disabled
$netadapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress 192.168.7.100 -PrefixLength 24 -Type Unicast -DefaultGateway 192.168.7.1
Set-DnsClientServerAddress -InterfaceAlias Ethernet -ServerAddresses 192.168.7.100
Rename-Computer Wcore -Restart

Konffaa verkon ja muuttaa nimen


Get-WindowsFeature AD-Domain-Services
Install-WindowsFeature -Name AD-Domain-Services 


Set-ExecutionPolicy remotesigned -force
Import-Module ADDSDeployment
Install-ADDSForest -CreateDnsDelegation:$false -DatabasePath C:\Windows\NTDS -DomainMode Win2012 -DomainName core.local -DomainNetbiosName  CORE -ForestMode Win2012 -InstallDns:$true -LogPath C:\Windows\NTDS -NoRebootOnCompletion:$false -SysvolPath C:\Windows\SYSVOL -Force:$true


käyttäjiä

New-ADUser -Name uuser -HomeDirectory "\\Wcore\home\%username%" -HomeDrive "K:" -Enabled $true -PasswordNotRequired $true -AccountPassword (Read-Host -AsSecureString "AccountPassword")


New-ADOrganizationalUnit -Name "taitaja2"
New-ADGroup -Name "kayttajat" -GroupScope Global -Path "ou=taitaja2,dc=core,dc=local"
New-ADGroup -Name "koneet" -GroupScope Global -Path "ou=taitaja2,dc=core,dc=local"
New-ADUser -Name "hermanni1" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true
New-ADUser -Name "hermanni2" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true
New-ADUser -Name "hermanni3" -AccountPassword (Read-Host -AsSecureString "AccountPassword") -HomeDirectory "\\Wcore\home\%username%\" -HomeDrive "S:" -Enabled $true
Mainos / Advertisement: