PSS and SCCM

Ask your Windows 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.
Locked
User avatar
gulmiguel
Posts: 8
Joined: Mon Mar 10, 2014 9:35 am

PSS and SCCM

Post by gulmiguel » Wed Aug 14, 2019 2:51 pm

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: 224
Joined: Thu Jun 01, 2017 7:20 am

Re: PSS and SCCM

Post by brittneyr » Mon Aug 19, 2019 7:28 am

I apologize for the delayed response. Perhaps you would find this article helpful:
https://blog.ctglobalservices.com/power ... n-console/
Brittney Ryn
SAPIEN Technologies, Inc.

User avatar
imdwalrus
Posts: 10
Joined: Sat Feb 04, 2012 5:11 am

Re: PSS and SCCM

Post by imdwalrus » Mon Aug 19, 2019 10:10 am

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: 13901
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PSS and SCCM

Post by jvierra » Mon Aug 19, 2019 10:35 am

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: 8
Joined: Mon Mar 10, 2014 9:35 am

Re: PSS and SCCM

Post by gulmiguel » Wed Aug 21, 2019 11:26 am

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: 13901
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PSS and SCCM

Post by jvierra » Wed Aug 21, 2019 11:53 am

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

Locked