You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Details of the scenario you tried and the problem that is occurring
In our environment, we have FSRM templates that already exist, but no threshold percentages have been defined for the quota template.
Verbose logs showing the problem
PS C:\Scripts> Test-DscConfiguration -Path C:\Scripts\UserHome_FSRMQuota\ -Verbose
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = TestConfiguration,'className' = MSFT_DSCLocalConfigurationManager,'namespaceNam
e' = root/Microsoft/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer MYTESTPC with user sid XXXXXXXXXXXXXXXXXXXXXXXXXXXX.
VERBOSE: [NAFILE008]: LCM: [ Start Compare ]
VERBOSE: [NAFILE008]: LCM: [ Start Resource ] [[FSRMQuotaTemplate]UserHome500MB]
VERBOSE: [NAFILE008]: LCM: [ Start Test ] [[FSRMQuotaTemplate]UserHome500MB]
VERBOSE: [NAFILE008]: [[FSRMQuotaTemplate]UserHome500MB] Test-TargetResource: Testing FSRM Quota Template "ZAF - HOME - 500MB".
Cannot bind argument to parameter 'DifferenceObject' because it is null.
+ CategoryInfo : InvalidData: (:) [], CimException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
+ PSComputerName : MYTESTPC
VERBOSE: [NAFILE008]: LCM: [ End Test ] [[FSRMQuotaTemplate]UserHome500MB] False in 0.0310 seconds.
VERBOSE: [NAFILE008]: LCM: [ *FAILED*Compare ] Completed processing compare operation. The operation returned False.
The PowerShell DSC resource '[FSRMQuotaTemplate]UserHome500MB' with SourceInfo 'C:\Scripts\FSRMUserHomeQuota.ps1::19::9::FSRMQuotaTemplate' threw one or more
non-terminating errors while running the Test-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer
to this channel for more details.
+ CategoryInfo : InvalidOperation: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : NonTerminatingErrorFromProvider
+ PSComputerName : MYTESTPC
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 0.183 seconds
The DSC configuration that is used to reproduce the issue (as detailed as possible)
configurationUserHome_FSRMQuota
{
param
(
[string[]]$NodeName=$env:COMPUTERNAME
)
Import-DscResource-Module FSRMDsc
$Name='ZAF - HOME - 500MB'$MailTo='[Source Io Owner Email]'$MailCC='[email protected]'$Subject='Home [Quota Threshold]% quota threshold exceeded'$Body='Your HOME drive folder has used [Quota Threshold]% of the space allocated to it on the server. The limit is [Quota Limit MB] MB and [Quota Used MB] has been used.'
Node $NodeName
{
FSRMQuotaTemplate UserHome500MB
{
Name =$Name
Description ='500 MB Hard Limit for User Home folders (DSC Created)'
Ensure ='Present'
Size =500MB
SoftLimit =$False
ThresholdPercentages =@( 95,100 )
} # End of FSRMQuotaTemplate Resource
FSRMQuotaTemplateAction UserHome500MBEmail95
{
Name =$Name
Percentage =95
Ensure ='Present'
Type ='Email'
Subject =$Subject
Body =$Body
MailBCC =''
MailCC =$MailCC
MailTo =$MailTo
DependsOn ="[FSRMQuotaTemplate]UserHome500MB"
} # End of FSRMQuotaTemplateAction Resource
FSRMQuotaTemplateAction UserHome500MBEmail100
{
Name =$Name
Percentage =100
Ensure ='Present'
Type ='Email'
Subject =$Subject
Body =$Body
MailBCC =''
MailCC =$MailCC
MailTo =$MailTo
DependsOn ="[FSRMQuotaTemplate]UserHome500MB"
} # End of FSRMQuotaTemplateAction Resource
FSRMAutoQuota DUsers
{
Path ='D:\HOME'
Ensure ='Present'
Disabled =$false
Template =$Name
} # End of FSRMAutoQuota Resource
} # End of Node
} # End of Configuration
The operating system the target node is running
OsName : Microsoft Windows Server 2016 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture : 64-bit
WindowsBuildLabEx : 14393.3808.amd64fre.rs1_release.200707-2105
OsLanguage : en-US
OsMuiLanguages : {en-US}
Version and build of PowerShell the target node is running
Details of the scenario you tried and the problem that is occurring
In our environment, we have FSRM templates that already exist, but no threshold percentages have been defined for the quota template.
Verbose logs showing the problem
Suggested solution to the issue
According to https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/compare-object?view=powershell-7, "If the reference or the difference objects are null ($null), Compare-Object generates a terminating error." This can be worked around by adjusting
FSRMDsc/source/DSCResources/DSC_FSRMQuotaTemplate/DSC_FSRMQuotaTemplate.psm1
Line 351 in 882a9f9
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used ('dev' if using current dev branch)
Currently using version 2.5.0.
Thanks for the great work on this DSC!
The text was updated successfully, but these errors were encountered: