Provision your PDI or company/customer instances q... - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

So you are about to reset your PDI? Or requesting a new PDI? Logging in for the first time on your fresh instance, and… darn, I have to set up all kinds of settings, personal preferences, utilities, etc. all over again! Can we somehow get those settings, personal preferences, utilities back on the fresh PDI? How can we start quicker with a slightly personal provisioned PDI?

 

I'm writing a few short Community Blogs on this topic. To share with you, how I tend to provision my PDI quicker.

Some of these ideas could also apply for company/customer instances. For example, if you are working as a consultant you will be faced with several companies, new instances every year. Yes, also on these instances you can get a head start!

 

The topics which I'm going to share in the upcoming days:
Setting-up your personal user account
Recommended System Properties and User Preferences
- Favorite Favorites
- Applying Plugins
Applying Utilities


Applying Plugins

In the previous three blogs we've set up a personal user account and a Fix Script to add Personalized Lists, recommended System Properties and User Preferences and our favorite Favorites. Another really annoying and very time consuming one… applying plugins all over again!

Plugins

There's are always some plugins you want to have activated on your Personal Developer Instance. For example a language plugin, some Performance Analytics content packs, Virtual Agent, etc.. Even if it's only one plugin, this could already take ages. For example activating the "I18N: Dutch Translations" plugin takes hours.

 

There is a way, to activate plugins through Server Side scripting. This is also an out-of-the-box used feature. For example have a look at Clone Cleanup Script "Install deactivated plugin". This uses the GlidePluginManager API.

Fix Script

Knowing the above, we might be able to come up with a Fix Script, to activate plugins in the background. For our example, let's go for plugins:
- Glide Virtual Agent[com.glide.cs.chatbot]
- Service Management Virtual Agent Topic Blocks [com.glideapp.cs.sm_topic_blocks]
- Virtual Agent Analytics Dashboard [com.glide.cs.pa]
- I18N: Dutch Translations [com.snc.i18n.dutch]

A basic script could already be something like:

 

var pm = new GlidePluginManager();
pm.registerPlugin("com.glide.cs.chatbot");

 

Because we are about to apply multiple plugins, let's set up an Array to make the code a little bit more efficient. Also let's wrap the code in a function, which you always should.

 

(function() {

	var pluginArr = [
		"com.glide.cs.chatbot",
		"com.glideapp.cs.sm_topic_blocks",
		"com.glide.cs.pa",
		"com.snc.i18n.dutch"
	];

	for(i = 0; i < pluginArr.length; i++) {
		var pm = new GlidePluginManager();
		pm.registerPlugin(pluginArr[i]);
	}

})();


Result

After running the Fix Script in the background, the plugins are getting activated. Some might just take seconds or a few minutes to finish. Some like the language plugins can take hours to finish. Just check the plugins list for the latest status of the installation.


Though this way, you don't have to wait for each plugin to finish, apply the next one manually, etc..

 

A short Fix Script, though a real time saver! Obviously you could also choose a different method, for example like a Scheduled Job which would execute this for you.


Applying Utilities

We made another nice step in provisioning your PDI or company/customer non-production instance with applying your Plugins. Next-up: Applying Utilities.

 

Keep an eye out for the next blog where I'll write about applying your favorite utilities rapidly!

---

If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Consultant @ Quint Technology

1x ServiceNow Developer MVP

1x ServiceNow Community MVP

---

LinkedIn

 

6 Comments