Created
December 14, 2023 18:27
-
-
Save jasontucker/853032649b85d2ef5e03a7f9f69ff35b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the current logged in user's username | |
$currentUser = Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty UserName | |
$username = $currentUser.Split('\')[1] | |
# Build the UserPrincipalName | |
$userPrincipalName = $username + "@domain.net" | |
# Install the Upload-WindowsAutopilotDeviceInfo script | |
Install-Script -Name Upload-WindowsAutopilotDeviceInfo -Force -Confirm:$False | |
# Submit computer info to Intune for enrollment | |
Upload-WindowsAutopilotDeviceInfo.ps1 -TenantName "Tenant.onmicrosoft.com" -GroupTag "Pre-Provision" -UserPrincipalName $userPrincipalName -Verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment