วันพฤหัสบดีที่ 6 กรกฎาคม พ.ศ. 2560

Scripts Power Shell: Create .exe file for join domain

Scripts Power Shell: Create .exe file for join domain


1. สร้าง Script

File Name -> JoinDomain.ps1

###-----------------------------------------------------------###  
###--------Author : Mr.Yingkamol Prukrattanakul----###    
###---MCP, MCSA, MCSE, MCT, MCST, SEC+----###  
###------Email<yingkamol_7@hotmail.com>--------###  
###----------------------------------------------------------###  
###/////////////////////////////..........\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\###  
###///////////////////////////////......\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\###  

$domain = "contoso.local"
$password = "password" | ConvertTo-SecureString -asPlainText -Force
$username = "contoso\username"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential

2. Download และติดตั้งไฟล์สำหรับแปลง PowerShell Scripts เป็น exe file

Download
อ้างอิง

3. แตกไฟล์ แล้ว สร้าง PowerShell Scripts มา แปลง

.\ps2exe.ps1 -inputfile C:\Users\XXX\Desktop\JoinDomain.ps1
-outputfile C:\Users\XXX\Desktop\JoinDomain.exe



ไม่มีความคิดเห็น:

แสดงความคิดเห็น