Jump to content


Search the Community

Showing results for tags 'Refresh Membership'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Cloud
    • Azure
    • Microsoft Intune
    • Office 365
    • Windows 365
  • General Stuff
    • General Chat
    • Events
    • Site News
    • Official Forum Supporters
    • Windows News
    • Suggestion box
    • Jobs
  • MDT, SMS, SCCM, Current Branch &Technical Preview
    • How do I ?
    • Microsoft Deployment Toolkit (MDT)
    • SMS 2003
    • Configuration Manager 2007
    • Configuration Manager 2012
    • System Center Configuration Manager (Current Branch)
    • Packaging
    • scripting
    • Endpoint Protection
  • Windows Client
    • how do I ?
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
    • windows screenshots
  • Windows Server
    • Windows Server General
    • Active Directory
    • Microsoft SQL Server
    • System Center Operations Manager
    • KMS
    • Windows Deployment Services
    • NAP
    • Failover Clustering
    • PKI
    • Hyper V
    • Exchange
    • IIS/apache/web server
    • System Center Data Protection Manager
    • System Center Service Manager
    • System Center App Controller
    • System Center Virtual Machine Manager
    • System Center Orchestrator
    • Lync
    • Application Virtualization
    • Sharepoint
    • WSUS

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests

Found 1 result

  1. Hi all, My goal is to Install applications with Dynamic Varibales which are set in a Device Collection. I created a query to link my device collection with an AD Security group (<-- It works) So during the task sequence I put the Computer as member of a security group (<-- It works) After this I execute a script which make a forest discovery and an update membership for the device Collection (Script is below) Param( [string[]]$Collections ) #/ Session Creation /*--------------------------------------------------------------------------------------------- Try { $MySession = New-PSSession [serverHostName] } Catch{ Write-Host "Error: $($_.Exception.Message)" } #/----------------------------------------------------------------------------------------------------------------- Invoke-Command -session $MySession -ArgumentList $Collections -script { param ($Collections) $Collections = $Collections.Split(',') #/ Import Module + Change Drive /*--------------------------------------------------------------------------------- Import-Module "E:\Services\Microsoft Configuration Manager\AdminConsole\bin\ConfigurationManager.psd1" $SCCMDrv = Get-PSDrive -PSProvider CMSite cd "$($SCCMDrv):" #/----------------------------------------------------------------------------------------------------------------- ###################################################################################### ################################ Forest Discovery #################################### ###################################################################################### Invoke-CMForestDiscovery -SiteCode "[siteCode]" ## ###################################################################################### #/---------------------------------------------------------------------------------------------------------------/# ###################################################################################### ################### Update Membership - Software Baseline ######################## ###################################################################################### $SiteCode = "[siteCode]" $SiteServer = "[serverHostName]" foreach ($Value in $Collections) { echo $Values Try{ $CollectionQuery = Get-WmiObject -Namespace "Root\SMS\Site_$SiteCode" -Class SMS_Collection ` -ComputerName $SiteServer -ErrorAction STOP -Filter "Name='$Value'" $CollectionQuery.RequestRefresh() } Catch{ Write-Host "Error: $($_.Exception.Message)" } } ## ###################################################################################### EXIT } Start-Sleep -s 30 (The task picture is joined to this topic) When I execute the script on a machine it works well and when I execute it through a task sequence I can see in SMSTS log that the task is successfull (Successfully completed the action (Refresh membership) with the exit code 0) But it does not update the membership at all ! Is it because of the configuration manager client ? or something else maybe ? I hope I was clear Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.