Windows11 初期設定自動化

本題

Windows11の設定が面倒なので自動化する。結果をメール送信する。

設定

  1. メール送信準備
    1.         Set-ExecutionPolicy RemoteSigned 
    2. $to = "recipient@gmail.com"
      $from = "your-email@gmail.com"
      $subject = "Test Email from PowerShell"
      $body = "This is a test email sent from PowerShell using Gmail SMTP server."
      $smtpServer = "smtp.gmail.com"
      $port = 587
      $credential = Get-Credential




  2. パスワード 最低10文字以上
    1. Get-LocalSecurityPolicy
    2. Set-LocalSecurityPolicy -MinimumPasswordLength 10
       
  3. あああ
  4. あああ
  5. あああ
  6. あああ
  7. あああ
  8. あああ
  9. あああ
  10. メール送信
    1. Send-MailMessage -To $to -From $from -Subject $subject -Body $body -SmtpServer $smtpServer -Port $port -UseSsl -Credential $credential

 

まとめ

コメント