MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
637 stars 281 forks source link

Modern Driver Management Not Working in OSD or Simple TS for SCCM #338

Open ThomasFaherty opened 2 years ago

ThomasFaherty commented 2 years ago

Hello,

I am just getting started with using this but am having a hard time. When I run a -BareMetal setup in OSD or a -DriverUpdate in a small Task Sequence I get the same issue. I tried using the debug commands. They look like they work but when I hit enter it goes down to a new line on the CMD and no new logs are generated like nothing happened. Here are the logs I do have

smsts.log

ApplyDriverPackage.log .

ThomasFaherty commented 2 years ago

Just to add some info here is what I am doing for testing -DriverUpdate

image

ThomasFaherty commented 2 years ago

Finally here is what I am doing for debug testing

In Admin CMD

powershell.exe -executionpolicy bypass -file "\svrgac-sccm\software\Modern Driver Management\Invoke-CMApplyDriverPackage.ps1" -DebugMode -Endpoint "svrgac-sccm.fqdn" -UserName "[admin account]" -Password "[My Password]" -TargetOSVersion 20H2

Unfortunately, when I run this no new logs are generated under the CCM Logs folder.

jmelgares commented 2 years ago

It looks like you're missing an end " in your parameters on the screenshot

-DriverUpdate -Endpoint "svrgac-sccm-p01.us.sagepub.org"

ThomasFaherty commented 2 years ago

I saw that and corrected it but same result. Right now I have been testing moving away from the poswershell step in OSD to trying to use CMD calling powershell instead to see if that will work.

ThomasFaherty commented 2 years ago

When I run command line the TS just gets stuck for hours so I end up rebooting the machine to clear it.

The one thing that gets me when I run the command line is this

sUniqueID.length() > 1, HRESULT=80004005 (X:\bt\1208157\repo\src\Framework\TSCore\resolvesource.cpp,254)

It seems like it's trying to use .Net but isn't able to.

ThomasFaherty commented 2 years ago

This product is so frustrating to work with it's like they intentionally want it to be as hard to work with as humanly possible. Everything ends with error code 1 which should send logs to the applydriverpackage.log but that never gets anything so I am left with a super generic error code and nothing to go on every time.

Here is a list of recent test all which when I hit enter both in CMD and PowerShell just move down to the next line like the command completed successfully even though we damn well know it didn't.

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2" -OSVersionFallback

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2"

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion 20H2

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2"

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**@sagepub.org" -Password "*****" -TargetOSVersion "20H2" -OSVersionFallback

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**@sagepub.org" -Password "*****" -TargetOSVersion "20H2"

Debug simple does not work, end of story. No logs are updated, zero info supplied, everything fully supported by the documentation, tried testing with a Global Admin account even that was give permissions to work with the adminservice no good. Adjusted permissions on the script to everyone, nothing. No matter what this just doesn't work and I want to shove my damn face through my screen.

If I didn't have to do this I would just leave this alone and never come back but my company wants drivers and BIOS fully up to date every 6 months. I am the only SCCM admin for a global company with thousands of users, tons of models, both Dell and HP since some countries can't buy HP. This would literally be my whole job if I had to do it manually but they wont hire anyone else. So I have to make this work or just never sleep again.

Ar5had07 commented 2 years ago

This product is so frustrating to work with it's like they intentionally want it to be as hard to work with as humanly possible. Everything ends with error code 1 which should send logs to the applydriverpackage.log but that never gets anything so I am left with a super generic error code and nothing to go on every time.

Here is a list of recent test all which when I hit enter both in CMD and PowerShell just move down to the next line like the command completed successfully even though we damn well know it didn't.

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2" -OSVersionFallback

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2"

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**" -Password "*****" -TargetOSVersion 20H2

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01" -UserName "tfa**" -Password "*****" -TargetOSVersion "20H2"

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**@sagepub.org" -Password "*****" -TargetOSVersion "20H2" -OSVersionFallback

.\Invoke-CMApplyDriverPackage.ps1 -DebugMode -Endpoint "svrgac-sccm-p01.sagepub.org" -UserName "tfa**@sagepub.org" -Password "*****" -TargetOSVersion "20H2"

Debug simple does not work, end of story. No logs are updated, zero info supplied, everything fully supported by the documentation, tried testing with a Global Admin account even that was give permissions to work with the adminservice no good. Adjusted permissions on the script to everyone, nothing. No matter what this just doesn't work and I want to shove my damn face through my screen.

If I didn't have to do this I would just leave this alone and never come back but my company wants drivers and BIOS fully up to date every 6 months. I am the only SCCM admin for a global company with thousands of users, tons of models, both Dell and HP since some countries can't buy HP. This would literally be my whole job if I had to do it manually but they wont hire anyone else. So I have to make this work or just never sleep again.

Ping me a message and I'll help you privately via remote session.

ThomasFaherty commented 2 years ago

Thank you for the offer but I am not sure I am comfortable with that idea just yet. I did make progress or I might consider it. Thing is I am throwing around Global Admin creds in the logs right now, so if I let you help me I would need to purge everything and work on it from the service account.

As far as the progress.

Realized I am really dumb but I found a hint in the logs

I saw that and decided to go back and make sure everything pertaining to the domain was correct. FQDN and Creds. Well I was trying to run the account as tf**@sagepub.org but it was supposed to be tf**@sagepub.com. That seemed to give me clean logs, exit code 0, with no errors when running -debug but the applydriver logs showed nothing still. So I thought maybe debug is only for the command line and if I switch to a different mode I might get something more.

So I abandoned the -debug and went with this

powershell.exe -NoProfile -ExecutionPolicy Bypass -File "\svr*--\software\Modern Driver Management\Invoke-CMApplyDriverPackage.ps1" -DriverUpdate -Endpoint "svr*--.us.sagepub.org" -TargetOSVersion "20H2" -OSVersionFallback

However, when I run that I am getting the same

which leads me back to thinking there is some kind of FQDN issue but then why did it run clean in debug, maybe the MDM variables are not working. There is no way to really tell. Logs say

No condition found for this rule, dynamic variables will be set Setting TS variable MDMUserName.
No condition found for this rule, dynamic variables will be set Setting TS variable MDMPasswrod.
Process completed with exit code 0

So it looks good but that doesn't mean that the script accepted it.

So I am just working on the new information I have now.

ThomasFaherty commented 2 years ago

Made a little more progress I think?

I took out the -TargetOSVersion from the -DriverUpdate command. Seems like it's not supported but now I am getting

Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.

It wants to write to the ApplyDriverPackage log but the above error is stopping it.

Ar5had07 commented 2 years ago

Made a little more progress I think?

I took out the -TargetOSVersion from the -DriverUpdate command. Seems like it's not supported but now I am getting

Join-Path : Cannot bind argument to parameter 'Path' because it is an empty string.

It wants to write to the ApplyDriverPackage log but the above error is stopping it.

When you're ready to let someone help you let me know. I won't be controlling your screen, just view and direct you to what changes you need to make. I was in your position at the beginning but now sorted.

Nisar-GitHub commented 6 months ago

Hi Ar5had07

need your help I am having same issue.