IT Master Services, Sparks Nevada - Your Information Technology Pros
Office Phone: (775) 287-0770
Email: [email protected]

Microsoft Tools

The #1 Microsoft Partner in Northern Nevada.

Looking for a new IT partner? Call Us Now (775) 287-0770

Microsoft Resources

Windows Powershell Tools

With the release of Powershell 7 preview, below is a line of code that you can run to update your Windows 10 computer. By defaul you will not get this update through Windows Update you have to run the MSI.

Invoke-Expression "& { $(Invoke-Restmethod } -UseMSI -Preview"

Offline Domain Join in Active Directory

Using offline domain joining makes adding computers to a domain offsite much easier. You need to run Djoin.exe at an elevated command prompt to provision the computer account metadata. When you run the provisioning command, the computer account metadata is created in a binary file that you specify as part of the command.

In summary, the process is as follows. In a Domain Controller, we run the appropriate djoin /provision command which produces an encoded txt file. We copy the file to the computer or server we are about to join into the domain and run the appropriate djoin /requestODJ command. After restarting, the offline domain join process will be completed.

Run the below line of code on a computer that has domain priviladges:
djoin /provision /domain [yourdomain.local] /machine [Computer Name] /savefile c:\[Computer Name].txt

Next run the below line of code on the computer that you want to add to a domain offline:

djoin /requestodj /loadfile c:\[Computer Name] /windowspath c:\windows /localos 

Import Users from a CSV File

We often use a comma-delimited (CSV) text file to create two users with the Import-Csv and New-ADUser cmdlets. We do this by splitting the first field of each entry in the text file so that we separate the first and surnames for the -GiveName and -Surname parameters of the New-ADUser cmdlet.

Import-Csv -Path c:\temp\users.csv | ForEach-Object {
    $givenName = $[0]
    $surname = $[1]
    New-ADUser -Name $ -Enabled $true –GivenName $givenName –Surname $surname -Accountpassword (ConvertTo-SecureString $_.password -AsPlainText -Force) -ChangePasswordAtLogon $true -SamAccountName $_.samaccountname –UserPrincipalName ($_.samaccountname+”@[Domain Name].local”) -City $ -Department $_.department

The first line of the .csv text file contains the field names then you can add as many users as you want.

Joe Blow,joeblow,PassW0rd!!11,Reno,IT
Mark Albin,markalbin,4SHH$$#AAAHh,Sparks,Admins