I made a batch file for joining computers to domain.
Powershell -command " Add-Computer -DomainName blabla.com -Credential blabla\bla "
works but I also want to add -Description with input.
Powershell -command "
$date = Get-Date
$cred= read-host -prompt 'IT username'
Add-Computer -DomainName blabla.com -Description "joined domain by $cred date $date" -Credential blabla\$cred "
did not work.
Powershell -command " $date = Get-Date "
Powershell -command " $cred= read-host -prompt 'IT username' "
Powershell -command " Add-Computer -DomainName blabla.com -Description "joined domain by $cred date $date" -Credential blabla\$cred "
didnt work either.
Please I need help