Thursday, December 24, 2020

"Driver PNP watchdog" after windows update on an MDT image (Windows10 20H2)

Error "Driver PNP watchdog" after windows update on an MDT image (Windows10 20H2)




I am using VMware to build and capture the image. The solution is to remove all the snapshot before updating windows. Once the upgrade finishes and restarts, you can create snapshots, and it will not cause BSOD when you restart the machine.

Friday, July 10, 2020

Create AD Account in Bulk Using PowerShell

There are quite a few articles on the internet how to use PowerShell to create a Bulk AD Accounts but what I found is they are not covering how to add or change certain attributes. I have created this script with the help of some awesome guys on the internet.

Courtesy: https://activedirectorypro.com/create-bulk-users-active-directory/#comments

# Import active directory module for running AD cmdlets
Import-Module ActiveDirectory
  
#Store the data from ADUsers.csv in the $ADUsers variable

$ADUsers = Import-csv C:\Users\senju\Desktop\ADUser\bulk_users1.csv

#Loop through each row containing user details in the CSV file 
foreach ($User in $ADUsers)
{
#Read user data from each field in each row and assign the data to a variable as below

$Username = $User.username
$Password = $User.password
$Firstname = $User.firstname
$Lastname = $User.lastname
$OU = $User.ou # Right click on the existing account, goto attribute editor and doubleclick distinguishedName and copy everything after CN
       $email      = $User.email
      $Password   = $User.Password
      $Description = $User.Description
      $MailNickName =$User.MailNickName
      $HideAddress =$User.HideAddress
      $Proxyaddresses =$User.Proxyaddresses
        
#Check to see if the user already exists in AD
if (Get-ADUser -F {SamAccountName -eq $Username})
{
#If user does exist, give a warning
Write-Warning "A user account with username $Username already exist in Active Directory."
}
else
{
#User does not exist then proceed to create the new user account

#Account will be created in the OU provided by the $OU variable read from the CSV file
     New-ADUser `
            -SamAccountName $Username `
            -UserPrincipalName "$Username@labo.local" `
            -Name "$Firstname $Lastname" `
            -GivenName $Firstname `
            -Surname $Lastname `
            -Enabled $True `
            -DisplayName "$Firstname $Lastname" `
            -Path $OU `
            -EmailAddress $email `
            -Description $Description `
            -AccountPassword (convertto-securestring $Password -AsPlainText -Force) -ChangePasswordAtLogon $False -PasswordNeverExpires $True
            
Set-ADUser -Id $UserName -Add @{
                MailNickName =$MailNickName
                }

Set-ADUser -Id $UserName -Add @{
                msExchHideFromAddressLists =$HideAddress
                }

      Set-ADUser -Identity $UserName -add @{
        Proxyaddresses=$Proxyaddresses
             }

Set-ADUser -Identity $Username -Enabled $True

         }
}

Remember to change the below items

1) Location of the CSV File
   $ADUsers = Import-csv C:\Users\senju\Desktop\ADUser\bulk_users1.csv


2) UPN 
   UserPrincipalName "$Username@labo.local (Should be your Domain)

3) Format of the excel sheet as shown below


Sunday, June 21, 2020

MDT Sysprep and Capture Fails - WinMain:The sysprep dialog box returned FALSE


In my case, the Sysprep shows running during the task sequence, but the machine restarts immediately. Upon restart, the TS fails with the below error




















I have checked the setupact.log, but everything looks alright except the below line.

WinMain:The sysprep dialog box returned FALSE

So I have checked the setuperr.log and only found the below lines

Error      [0x0f0043] SYSPRP WinMain:The sysprep dialog box returned FALSE
Error         [0x0f0043] SYSPRP WinMain:The sysprep dialog box returned FALSE
Error      [0x0f0043] SYSPRP WinMain:The sysprep dialog box returned FALSE

Most of the time, Sysprep fails due to one or more windows app.so I always run the below command before the capture.

Get-AppxPackage -allusers | where-object {$_.name –notlike "*calc*"} | where-object {$_.name –notlike "*photo*"} | Remove-AppxPackage

The capture was still failing. I have double-checked by running the below command and made sure that the windows apps are removed. (Note: I haven’t removed any .net framework apps)

Run Get-AppxPackage -AllUser | Where PublisherId -eq 8wekyb3d8bbwe | Format-List -Property PackageFullName,PackageUserInformation

Below is what I did to fix my issue with Sysprep.

        Made sure Windows is up to date by running windows update.

      Updated Java to the latest version

     Checked the registry Sysprep registry keys (In My case CleanupState DWord was missing)

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState\ 
Set to value: 2

HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\GeneralizationState\Set to value: 7
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion
\SoftwareProtectionPlatform\SkipRearm 
Set to value: 1 


     Delete the Sysprep Panther folder (C:\windows\system32\sysprep\panther)


        Restarted the machine and after the restart, the Sysprep ran successfully in Task Sequence.



Wednesday, April 1, 2020

Unable to set up budgets on Azure Subscription.

Unable to create budgets on Azure Subscription. Getting Message “Support Coming Soon”


I have tried to change the scope, logged off from the portal and login back and also tried to change the scope resulted in below error.

I have also waited 3-4 hours and checked the Service Health.
I was able to create a budget by typing cost management + Billing in the search box 

Once I clicked on create a budget, I was able to create budget.
The above step also enabled the budget option if you access it through subscription menu


Saturday, March 28, 2020

Unable to see the .csv preview in outlook


The solution is modifying the registry. Please take back up of the registry before proceeding further.
Click Start -> Run and type Regedit.
Expand HKEY_CLASSES_ROOT
You will see ShellEx and a Key underneath with a string value

You have to create the ShellEx and {8895b1c6-b41f-4c1c-a562-0d564250836f} key under .CSV in HKEY_ClASSES_ROOT
On my machine I can only see the below under .csv

 Right click on .CSV and select New and select Key
And enter ShellEx for the key Value
Now Right Click on ShellEx and Create a new key and name
{8895b1c6-b41f-4c1c-a562-0d564250836f}
You can always copy the key from .xls
Now highlight {8895b1c6-b41f-4c1c-a562-0d564250836f} and Double Click Default 
Enter the value {00020827-0000-0000-C000-000000000046}
Click Ok and exit out of registry.
Logoff and log in back and you should be able to see .csv preview in outlook


Outlook search box moved to the top of the screen


To move the outlook search button, click on the ‘Coming Soon’ label on the top right-hand corner and change it to off. Restart outlook and you will see the search box moved back to the correct location.
If coming soon is already off and the search bar is on top then turn on the ‘coming soon’ and restart outlook and then turn it off again.

Use office deployment tool to install Office365 on MDT Image

 Download the Office deployment tool from Microsoft https://www.microsoft.com/en-au/download/details.aspx?id=49117 Extract the file to y...