ユーザー作成 †
パスワード付きのユーザーを追加 †
「パスワードを無期限にする」を有効状態(チェックあり)に変更 †
Set-LocalUser -Name test -PasswordNeverExpires $true
グループにユーザーを追加 †
ユーザーの各種情報を表示 †
Get-LocalUser -Name [アカウント名] | Format-List -Property *
ユーザーのホームディレクトリを自動生成した上に test フォルダを作成 †
$userHomeDir = "C:\Users\$userName"
$securePassword = ConvertTo-SecureString [パスワード] -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList $userName,$securePassword
Start-Process -FilePath cmd.exe -ArgumentList "/c mkdir $userHomeDir\test" -WindowStyle Hidden -Credential $cred -ErrorAction SilentlyContinue
ユーザープロファイル †
ログイン †
トラブルシューティング †
初回ログイン時にホームディレクトリが作成される †