Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8798829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:10:52+00:00 2026-06-14T00:10:52+00:00

I have several COM+ applications that make use of role based security. During any

  • 0

I have several COM+ applications that make use of role based security. During any troubleshooting, manually checking each component to ensure that both the ‘Enforce component level access checks’ and ‘Roles explicity set for selected item(s)’ boxes are checked can be a pain.

Half the problem has been addressed with the script below (Enforce component level access checks), but I am struggling to find a way to programatically determine if any roles that are assigned to the component also have their checkbox enabled.

Any help much appreciated!

Clear-Host;

$comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1");
$applications = $comAdmin.GetCollection("Applications") ;
$applications.Populate() ;
$appfilter = "ABC";

foreach ($application in $applications){

  if($application.name.substring(0,3) -eq $appfilter){

    try{    
          $components = $applications.GetCollection("Components",$application.key)
          $components.Populate()

          foreach ($component in $components){

            $componentName = $component.Name;
                Write-Host $componentName;

            $accesschecks = $component.Value("ComponentAccessChecksEnabled");

            Write-Host "Access Checks Enabled: " -NoNewLine;
            Switch ($accesschecks){
                $true{Write-Host $accesschecks -ForegroundColor Green}
                $false{Write-Host $accesschecks -ForegroundColor red -BackgroundColor white}
            }   

            $roles = $applications.GetCollection("Roles",$application.key) ;
            $roles.Populate();
            $rolename = $roles.Item(0).Name;

            #$roleenabled = !!???!!     

            Write-Host "Role: $rolename Enabled: " -NoNewLine;
            Switch ($roleenabled){
                $true{Write-Host $roleenabled -ForegroundColor Green}
                $false{Write-Host $roleenabled -ForegroundColor red -BackgroundColor white}
            } 
            Write-Host;

             }
    }
    catch{}
  }
Write-Host "-------------------------------------";
}

Example COM+ dialogue showing enabled roles

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T00:10:53+00:00Added an answer on June 14, 2026 at 12:10 am

    Cracked it. If the role box is not checked within the Component security settings then the role is not listed in the RolesforComponent collection, as if there is no role at all. Also there may be multiple roles assigned to a component so needed another loop to enumerate:

    Clear-Host;
    
    $comAdmin = New-Object -com ("COMAdmin.COMAdminCatalog.1");
    $applications = $comAdmin.GetCollection("Applications") ;
    $applications.Populate() ;
    $appfilter = "ABC";
    
    foreach ($application in $applications){
    
        if($application.name.substring(0,3) -eq $appfilter){
    
                try{  
    
                        Write-Host $application.name -ForegroundColor White;
                       $components = $applications.GetCollection("Components",$application.key)
                    $components.Populate()
    
                    foreach ($component in $components){
                    $componentName = $component.Name;
                        $componentID = $component.Value("CLSID");
                            Write-Host "*"$componentName;
                    $accesschecks = $component.Value("ComponentAccessChecksEnabled");
                            Write-Host "  Access Checks Enabled: " -NoNewLine;
    
                      Switch ($accesschecks){
                           $true{Write-Host $accesschecks -ForegroundColor Blue -BackgroundColor Green}
                               $false{Write-Host $accesschecks -ForegroundColor White -BackgroundColor Red}
                                }
                    }   
    
                            $RolesForComponent = $components.GetCollection("RolesForComponent",$component.Value("CLSID"))
                            $RolesForComponent.Populate();
    
                            If ($RolesForComponent.Count -eq 0){
                                Write-Host "  " -NoNewLine;
                                Write-Host "Check Roles!" -ForegroundColor White -BackgroundColor Red;
                            }
                            Else{
                                foreach ($role in $RolesForComponent){
                    $rolename = $role.Name;
                                Write-Host "  " -NoNewLine;
                                Write-Host $rolename -NoNewLine;
                                Write-Host "  " -NoNewLine;
                                Write-Host "Role OK" -ForegroundColor Blue -BackgroundColor Green;
                                Write-Host;
                           }        
                            }
                }
    
            catch{}
    
        }
        Write-Host "----------------------------------------------------------------------";
    }
    

    More info here MSDN RolesForComponent collection

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C++ dll which implements several COM interfaces, that I'm trying to
I have an ItemRenderer that is shared by several applications (inside a DataGrid), and
I have an application that makes use of a canvas that contains several WPF
We have an application that uses several out of process COM objects for various
I have several sites in different domains: example.com , example.org , mail.example.com and passport.example.org
I have several projects open in an Eclipse workspace. Like so: com.harbl.project.one com.harbl.project.two com.harbl.project.three
I have looked at several options like: * http://blog.waynehartman.com/archive/2012/01/07/uistoryboard-on-ios-5-the-good-the-bad-and-the.aspx * UIPopoverController Anchor Position *
I have a domain name: TestSite.com. I create several subdomains for this site and
I have a url which could be www.website.com/order/?pg3=2 or www.website.com/orderstatus/?pg2= There could be several
I need to write some data in several database. I choose sqlapi.com I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.