Category Archives: Windows

Windows family products

How to run karma in TeamCity on Windows server

This is one solution and it works for us, there is also a node and npm plugin for TeamCity that I did not try, it is found here https://github.com/jonnyzzz/TeamCity.Node.

Setup nodejs, npm and karma for TeamCity on Windows server.

Install nodejs

Install nodejs for windows using the latest installer from https://nodejs.org/en/download/

Configure npm global

To be able to call karma and npm from TeamCity command line build step you need to
update the global catalogs for npm (as described in this post http://stackoverflow.com/questions/7300132/how-to-use-npm-with-node-exe/9366416#9366416)

Create the global (admin) location(s) for npm modules
“C:\ProgramData\npm-cache” – npm modules will go here
“C:\ProgramData\npm” – binary scripts for globally installed modules will go here
“C:\ProgramData\npm\node_modules” – globally installed modules will go here
And set the permissions appropriately
administrators: modify
authenticated users: read/execute

Run the following npm commands in a command prompt
npm config –global set prefix “C:\ProgramData\npm”
npm config –global set cache “C:\ProgramData\npm-cache”

Add npm and nodejs to your System’s Path environment variable

From the GUI, in “Control panel” search for “advanced system setings” open it and select “Environment variables” or run “sysdm.cpl” from cmd to open the “System Properties”
Add the following to PATH: “;C:\Program Files\nodejs\;C:\ProgramData\npm”

Install karma-cli in “C:\ProgramData\npm”

Run the command “npm install karma-cli -g” and verify that i is installed in ¬†“C:\ProgramData\npm”

Install PhantomJs (Optional)

(phantomjs will be downloaded and installed in each build folder if it is not found locally)
Download the zip-file for Windows http://phantomjs.org/download.html
and extract to “C:\PhantomJs\bin\phantomjs” (create the path)

For npm to find phantomjs in a TeamCity build step,
add the path “C:\PhantomJs\bin\phantomjs\bin\phantomjs.exe” to a new environment variable PHANTOMJS_BIN (created in “Environment variables” )

Restart the TeamCity service just to be sure.
To run the karma tests

Save the TeamCity reporter in your project (read this http://karma-runner.github.io/0.13/plus/teamcity.html)
by running the command “npm i –save-dev karma-teamcity-reporter”

Add two command line build steps to your build.
first one containing the command “npm install” – to update/install your “node_modules”
and the second containing the command “karma start –reporters teamcity –single-run –browsers PhantomJS –colors false”

And now you should have a great karma ūüėČ

Happy building!
//Jimi

Powershell Script to add home folder path in Windows 2003 AD on users in list of email addresses

So you need to assign and create home folders to a bunch of users and don¬īt really feel like doing it all the GUI way one by one?

I had this problem and I also needed to specify what users to create folders for by a list, and since email addresses are a good primary key I based my script on that.

This script will create folders, set permissions and update this information in the user objects in AD

First do Read

In Microsofts “How to assign a home folder to a user” you will find out how assign home folders in GUI or by scripting. When assigning a home folder in AD Users and Computers the AD takes care of creating the folder on specified share, but when assigning a home folder using the scripts they provide all you get is the path mapped in the users computer and in the AD user object, the folder is not created.

Then do Read

This script needs the path to a text file with the users email addresses** (one address per line), domain name,path to root of user share and a drive letter to the home folder (use a “high” one so you don¬īt get problems with card readers etc.).

** Can easily be changed to display name or samaccountname

! The script will set the users home folder name to “samaccountname_givenName-sn” (f ex. “jifr_Jimi-Friis”)

 

Powershell Script to add home folder path in Windows 2003 AD on users in list of email addresses

Script to add path to home folder in Windows 2003 AD

Then do Copy modify and enjoy! as always on your on risk ūüôā

##***************************************************************************
## ***** Script Header *****

## File Name:  AD_getUserLogonName_fromList_CreateAndSetHomFolder.ps1
# Author : Jimi Friis, www.newsweb.se
# Created: 2012-06-05
#
# Purpose:  Set up home folder for Active Directory users specified as email adresses in a text file
# Continue reading Powershell Script to add home folder path in Windows 2003 AD on users in list of email addresses

Script to Uninstall Eset Nod32 and install Forefront Endpoint protection from GPO

How to uninstall Eset Nod32 Antivirus and install FEP (Forefront Endpoint Protection) also known as Microsoft Essentials Antivirus on Windows clients using a vbscript.

In my environment we have been using Eset Nod32 Business Edition antivirus version 4.

Nod32 is a light and stable antivirus with a decent footprint. The Eset Administration is good and powerful if you spend a couple of days learning it.

But!.

Wen we started to use a business web application, using the java editor PageFlex .EDIT, from our business partner www.webtopsolutions.se our users complained on that editing tool system, and it was really slow, loading the page in about 40 to 50 seconds, and editing was really slow with 1 to 2 seconds per key stroke .

After some troubleshooting we found that Nod32 was the reason and for some reason there is no way to exclude a web site from the antivirus, there is a setting to exclude URLs from scanning but the URL will still be processed by Nod32 in some way. One possible option is to disable the scanning of web pages completely, but that was not an option I liked.

The quick fix on this problem is to change antivirus to FEP wich is free at least if you have a subscription from Microsoft, else there is the essentials version.

To manage and install FEP you have two options, one is to use System Center 2012 Endpoint Protection (or SCCM) and it requires SQL Server Standard or Enterprise editions. The other option is to install the client manually or by script and use GPO settings to mange the client settings.

This is how I install the FEP client using a GPO user logon script, making sure that Nod32 is uninstalled before installing. It is tested on Windows XP and Windows 7, x86 and x64.

Wen running the script on my Windows 7 the UAC popped up, I haven¬īt tested if that happens when the script is run by the GPO, so you might need to test it and tell the users if the prompt will¬† pop up.

Thanks to Jakob Gottlieb Svendsen, http://blog.coretech.dk/jgs, for providing a nice start to this script.

I hope this will be of help, and don¬īt forget to turn off the password protection in Nod32 or the uninstall will fail.

 

Use this script at your own risk and test it before deploying to production environment.

Continue reading Script to Uninstall Eset Nod32 and install Forefront Endpoint protection from GPO