api0cradle / PowershellScripts

A collection of useful Powershell Scripts that I have created
45 stars 20 forks source link

MDT-Doc-Script_0.6.ps1 Remotely #1

Open BClev opened 8 years ago

BClev commented 8 years ago

You had previously mentioned on the MSITPros blog that you know how to run this script from a computer that has MSWord installed to inventory a remote server with MDT.

I have the DeploymentShare drive of the remote server mapped to my regular computer, but I can't figure how to point the script at it.

This is the error I receive.

Getting Deployment shares
Get-MDTPersistentDrive : The term 'Get-MDTPersistentDrive' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Users\ME\Downloads\MDT-Doc-Script_0.6.ps1:33 char:20
+ $DeploymentShare = Get-MDTPersistentDrive | format-list | out-string
+                    ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-MDTPersistentDrive:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Creating Word Document
Writing documentation to Word document
get-mdtpersistentdrive : The term 'get-mdtpersistentdrive' is not recognized as the name of a cmdlet, function, script file,
or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At C:\Users\ME\Downloads\MDT-Doc-Script_0.6.ps1:100 char:1
+ get-mdtpersistentdrive | foreach{ New-PSDrive -Name $_.name -PSProvid ...
+ ~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (get-mdtpersistentdrive:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Get-PSDrive : Cannot find a provider with the name 'MDTProvider'.
At C:\Users\ME\Downloads\MDT-Doc-Script_0.6.ps1:103 char:1
+ Get-PSDrive -PSProvider MDTProvider | foreach{$psdrivevar = $_.name+' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (System.String[]:String[]) [Get-PSDrive], ProviderNotFoundException
    + FullyQualifiedErrorId : GetLocationNoMatchingDrive,Microsoft.PowerShell.Commands.GetPSDriveCommand

Get-PSDrive : Cannot find a provider with the name 'MDTProvider'.
At C:\Users\ME\Downloads\MDT-Doc-Script_0.6.ps1:113 char:1
+ Get-PSDrive -PSProvider MDTProvider | foreach{$psdrivevar = $_.name+' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (System.String[]:String[]) [Get-PSDrive], ProviderNotFoundException
    + FullyQualifiedErrorId : GetLocationNoMatchingDrive,Microsoft.PowerShell.Commands.GetPSDriveCommand

Saving Word document
Done

Even if I import the command Add-PSSnapIn Microsoft.BDD.PSSnapIn, the provider "MDTProvider" error still occurs.

api0cradle commented 8 years ago

Hi. I will check this out as soon as possible. It has been a while since i used this script. You have MDT installed locally on the client machine?

BClev commented 8 years ago

My local machine (L1) is a regular work desktop with Word. My remote server (RS1) is the one with MDT. I don't have a license to put Word on RS1.