Code Monkey home page Code Monkey logo

Comments (9)

BladeFireLight avatar BladeFireLight commented on August 28, 2024

Just droping the Administrator requiremend from the module resuls in this error

Start-LabConfiguration -ConfigurationData G:\VirtualEngineLab\en-US\Example.psd1 -Path G:\TestLab\Configurations
This Resource requires to be run as an Administrator.
At C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\PSDesiredStateConfiguration\DSCResources\MSFT_WindowsOptionalFeature\MSFT_WindowsOptionalFeature.psm1:277 char:9
+         throw $LocalizedData.ElevationRequired
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (This Resource r... Administrator.:String) [], RuntimeException
    + FullyQualifiedErrorId : This Resource requires to be run as an Administrator.

The only way to run as a basic user would be to require a credential parameter for an administrator account and then start additional powershell sessions running as the admin when it's required.

I like BITS, I wonder if there is another option to have bits run as system.

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

I can verify that the underlying issue with runas other user for admin is inherent in bits

PS G:\temp> bitsadmin /create testjob

BITSADMIN version 3.0 [ 7.8.10240 ]
BITS administration utility.
(C) Copyright 2000-2006 Microsoft Corp.

BITSAdmin is deprecated and is not guaranteed to be available in future versions of Windows.
Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets.

Created job {68B1C5E1-E682-4770-B678-24EA8B0AD69C}.
PS G:\temp> bitsadmin /addfile testjob http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WI
NBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO g:\temp\test.iso

BITSADMIN version 3.0 [ 7.8.10240 ]
BITS administration utility.
(C) Copyright 2000-2006 Microsoft Corp.

BITSAdmin is deprecated and is not guaranteed to be available in future versions of Windows.
Administrative tools for the BITS service are now provided by BITS PowerShell cmdlets.

Unable to add file to job - 0x800704dd
The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist.

from lability.

iainbrighton avatar iainbrighton commented on August 28, 2024

Dropping Admin rights will cause issues, but it would permit you to download the resources!

I think it will be less confusing all round if we implement Invoke-WebRequest rather than BITS. Running some cmdlets as a standard user and others under a different context will just lead to a load of questions!

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

Not looking good

WARNING: Unable to query CCM_ClientUtilities: Invalid namespace 
Resource download failed: http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBL
UE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO.
At G:\VirtualEngineLab\Lib\Resource.ps1:212 char:13
+             throw ($localized.ResourceDownloadFailedError -f $Uri);
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Resource downlo..._EN-US_DV9.ISO.:String) [], RuntimeException
    + FullyQualifiedErrorId : Resource download failed: http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4F 
   E-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO.

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

I think I traced it down to this

PS C:\WINDOWS\system32>             [System.UInt32] $contentLength = $webClient.ResponseHeaders['Content-Length'];
Cannot convert value "4542291968" to type "System.UInt32". Error: "Value was either too large or too small for 
a UInt32."
At line:1 char:13
+             [System.UInt32] $contentLength = $webClient.ResponseHeade ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException


PS C:\WINDOWS\system32> $webClient.ResponseHeaders['Content-Length'];
4542291968

PS C:\WINDOWS\system32> "$([int32]::MinValue) to $([int32]::MaxValue)"
-2147483648 to 2147483647

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

Changed UInt32 to UInt64, and it basically hung for a a bit then error our wit the same Resource download Failed error. but running the commands in InvokeWebClientDownload directly worked to download

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

guess I spoke too soon, tried again with a clean PowerShell and it started downloading.

from lability.

BladeFireLight avatar BladeFireLight commented on August 28, 2024

Bottom line, you need Uint64 for the download progress calculations

from lability.

iainbrighton avatar iainbrighton commented on August 28, 2024

I'm closing this one out. If you still have problems with the Proxy server authentication, we can open another issue.

from lability.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.