PSS and SCCM

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
gulmiguel
Posts: 19
Last visit: Thu Apr 04, 2024 8:18 am

PSS and SCCM

Post by gulmiguel »

Product, version and build: PowerShell Studio 64-bit version 5.6.167
32 or 64 bit version of product:
Operating system: Installed on Windows 10 Enterprise (64-bit)
32 or 64 bit OS:

I've been working with Microsoft's System Center Configuration Manager (SCCM) (current branch 1902) and I was having difficulty with creating some of my queries. Fortunately, I have a couple of good reference books and one of them reminded me that the majority of Microsoft's products have underlying PowerShell cmdlets for those of us who don't always want to do GUI. I was happy as a clam to learn about this and I was all set to begin. However, my SCCM console is on one workstation and my PSS is on a virtual workstation which I constructed specifically for developing, scripting and whatever else is needed. SCCM has a menu option where it can directly connect to PowerShell from within SCCM
sccm-psh menu.jpg
. Now here is where my question comes from. I can put another SCCM console (guest only) onto my other workstation where PSS is residing. However, I don't know how to change/create the necessary profile so that when this 'Connect' menu option is chosen, it comes up in PSS instead of PowerShell/PowerShell ISE. It seems logical that such a thing is possible, so I ask you, how do I make this happen? Thank you in advance for any guidance that you can provide a NOOB like myself.
User avatar
brittneyr
Site Admin
Posts: 1669
Last visit: Fri Apr 12, 2024 2:35 pm
Answers: 39
Been upvoted: 31 times

Re: PSS and SCCM

Post by brittneyr »

I apologize for the delayed response. Perhaps you would find this article helpful:
https://blog.ctglobalservices.com/power ... n-console/
Brittney
SAPIEN Technologies, Inc.
User avatar
imdwalrus
Posts: 10
Last visit: Wed Sep 08, 2021 10:42 am

Re: PSS and SCCM

Post by imdwalrus »

This doesn't exactly answer your question, but it might help anyway. I created a function, Get-SCCM, in my $profile.AllUsersAllHosts profile that imports the SCCM PowerShell module and then switches to the CMSite provider:

Import-Module $($env:SMS_ADMIN_UI_PATH).Replace('i386','ConfigurationManager.psd1')
Set-Location XXX:

That allows me to import the module relatively quickly into my PSS host whenever I need it. Executing those statements in my profile, but I got tired of waiting for the module to load at times when I didn't need it. You also can load the module from a remote site so that you don't have to install the admin console locally, but it's REALLY slow to load.

Regards,

Mike
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PSS and SCCM

Post by jvierra »

imdwalrus wrote: Mon Aug 19, 2019 10:10 am TThat allows me to import the module relatively quickly into my PSS host whenever I need it. Executing those statements in my profile, but I got tired of waiting for the module to load at times when I didn't need it. You also can load the module from a remote site so that you don't have to install the admin console locally, but it's REALLY slow to load.
I add these to my profile as functions so that they only load when I need them.

You can also create a module that contains all utility functions that you use intermittently.

Load times for subsystems like SCCM, Exchange, SharePoint and others can be very slow depending on you network.
User avatar
gulmiguel
Posts: 19
Last visit: Thu Apr 04, 2024 8:18 am

Re: PSS and SCCM

Post by gulmiguel »

I wish to extend sincere thanks to all three (3) of you who responded. I ended up doing something of a hybrid of all your suggestions. I've been playing around with the Profile Editor. (Is this a good place to share how much I love the DevOps Suite 2019? AWESOME!!) I wish that there was more documentation on the DevOps Suite. (Is anyone working on a book or something? Definitely a need exists for it. Hell, I'll collaborate with someone to write the bloody thing. Just remember that I'm a noob please. :D )

Things are going a bit slowly because in addition to getting PowerShell to play nice with SCCM, I also have a lot of PowerCLI to incorporate since I'm in vSphere every day. Some days I catch on quickly and some days it takes an hour to get a query and export-csv snippet to work "just right".

Again, please accept my humble thanks. All of you definitely helped me get past that 'sandtrap'. Onward and upward!!

LLAP,
Miguel
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PSS and SCCM

Post by jvierra »

PowerShell Studio has an built-in manual on the help tab. Also review the numerous blog articles for more detailed discussions on using special features of PSS and PowerShell.

Here is a link to the broad documentation, samples and blogs page.

https://info.sapien.com

Use the RSS feed for updates: https://info.sapien.com/index.php?format=feed&type=rss
This topic is 4 years and 7 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked