Devenv works in CMD but not in jenkins - The license for Visual Studio has expired. The evaluation period for this product has ended

I am using devenv to create ispac file for SSIS. I am able to create SSIS package from windows CMD, but if i use a same command in jenkins it is saying license expired.

Microsoft Visual Studio 2017 Version 15.0.28307.1800. Copyright (C) Microsoft Corp. All rights reserved. The license for Visual Studio has expired. The evaluation period for this product has ended.

“C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.com” “E:\Program Files\Jenkins.jenkins\workspace\ETL_solution_Load\ETL_Load.sln” /rebuild Development /Project “E:\Program Files\Jenkins.jenkins\workspace\ETL_solution_Load\ETL_Load\EDW_SOLM_Load.dtproj” /projectconfig Development

Microsoft Visual Studio 2017 Version 15.0.28307.1800.
Copyright (C) Microsoft Corp. All rights reserved.

The license for Visual Studio has expired.

The evaluation period for this product has ended.

Need help

As a very highlevel general topic for these kinds of things.

“How do I compare environments”. I’m a linux guy, so I can’t help too much in windows, but I would recommend running whoami or How do I get the current username in Windows PowerShell? - Stack Overflow to find out what user jenkins is running as. Then run set to print out your environmental variables, and see whats different.

My guess is that its a different user, different env variable, or different registry key, but i don’t know enough to direct you more than that.