I want to script the setup of a machine with powershell and I have no idea how to find the names of the module. I want to build the same script than the script bellow but for asp.net mvc 3, URL Rewrite 2.0, URL authorization...
I tried to search in google, web plateform installer... Am I missing something ?
Ex :
Import-Module ServerManager
$features = #(
"Web-WebServer",
"Web-Static-Content",
"Web-Http-Errors",
"Web-Http-Redirect",
"Web-Stat-Compression",
"Web-Filtering",
"Web-Asp-Net45",
"Web-Net-Ext45",
"Web-ISAPI-Ext",
"Web-ISAPI-Filter",
"Web-Mgmt-Console",
"Web-Mgmt-Tools",
"NET-Framework-45-ASPNET"
)
Add-WindowsFeature $features -Verbose
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install -y webdeploy
Open a PowerShell prompt and use the Get-WindowsFeature cmdlet.
I believe this PS module is installed by default on servers. For client machines, running Windows 7 for example, you can install the Remote Server Management Tools - https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=7887
Related
I am facing troubles in installing the agent manually If I follow the installation guide in the TFS portal.
These steps not working for me and gives unexpected errors:
what are the clear steps for that?
Error like:
VS30063:You are not authorized to access http://xxx.xxx.x.xxx:8080. Failed to
connect.
it's not reasonable because I have administrator privilege in server in TFS all but I can't pass it
what about workaround
1- download agent files
2- put them at any location like C:\agents
3- at PowerShell cd C:\agents
4- .\config.cmd --deploymentgroup --deploymentgroupname "deploymentgroupname" --agent $env:COMPUTERNAME --runasservice --work '_work' --url 'http://xxx.xxx.xxx.xxx/tfs/' --collectionname 'DefaultCollection' --projectname 'projectname' --auth Negotiate;
5- enter username and password
I am trying to setup CI for a ASP.NET project. There is a publish profile defined in VS, which is working fine. (I can deploy the page to a remote IIS server.)
I want to automate this, using GitLab, so I am looking for a command line equivalent of the publish action of VS.
The publish profile files that VS is using can be found under Properties\PublishProfiles. I have 2 files here:
myServer.pubxml (contains the username to use for deploy, and other server data, like hostname)
myServer.pubxml.user (contains the encrypted password for the user)
My attempts to deploy/publish on the command line:
dotnet publish /p:PublishProfile=myServer.pubxml
This results in the following error:
MSDEPLOY : error Code: ERROR_USER_UNAUTHORIZED [C:\Users\myUser\source\repos\Beam Time Request\BeantimeRequest\BeantimeRequest.csproj] Error : The remote server returned an error : (401) Unauthorized. [C:\Users\myUser\source\repos\Beam Time Request\BeantimeRequest\BeantimeRequest.csproj] MSDEPLOY : error count: 1. [C:\Users\myUser\source\repos\Beam Time Request\BeantimeRequest\BeantimeRequest.csproj]
Which is logical, as I have not defined the password.
I can set the password on the command line, like this:
dotnet publish /p:PublishProfile=myServer.pubxml /p:password=myPassword
And this works, but I want to avoid having the password written in plain text.
So how could I tell dotnet publish to use the password from the myServer.pubxml.user file?
If anyone come across this:
I solved this with a GitLab Secret, as follows:
Defined a new GitLab Secret for the repository, called DEPLOY_PASSWD
using the following command to deploy:
dotnet publish -c Release -o Publish /p:PublishProfile=myServer.pubxml /p:password=$DEPLOY_PASSWD"
I want to run command prompt arguments using a ASP.Net application. I am using visual studio 2013.
Is it possible?
the followings are the command prompt commands I want to execute using MVC application to create and run a job in jenkins
C:\Users\ .jenkins java -jar C:\Users.jenkins\war\WEB-INF\jenkins- cli.jar -s http://localhost create-job myjob < C:\Users\Desktop\config.xml
C:\Users\ .jenkins java -jar C:\Users.jenkins\war\WEB-INF\jenkins-cli.jar -s http://localhost / build myjob
Just to be sure, you want to run these command line tools on thee webserver, right? Not on the client connecting to the web application.
If the former, it's pretty straightforward, make sure that you IIS application pool is running under a user account that is allowed to execute these tools and use the Process class together with the ProcessStartInfo class to invoke the commandline and wait for the results:
string jobname = jobNameFromInput;
if (!Regex.IsMatch(jobname, "^(\"[a-z0-9-_ ]+\"|'[a-z0-9-_ ]+'|[a-z0-9-_]+)$", RegexOptions.IgnoreCase)
{
throw SecurityException("Invalid job name");
}
ProcessStartInfo startInfo = new ProcessStartInfo("C:\Users.jenkins\java.exe");
string argumentTemplate = "-jar C:\\Users.jenkins\\war\\WEB-INF\\jenkins-cli.jar -s http://localhost / build {0}";
startInfo.Arguments = string.Format(argumentTemplate, jobname);
Process.Start(startInfo);
Process.WaitForExit();
See:
Process.WaitForExit
Process.Start
Hi can someone point out were i'm going wrong with my code
I receive errors like below upon invoking
The Windows PowerShell snap-in 'Microsoft.Exchange.Management.PowerShell.Admin' is not installed on this machine.
he term 'MailboxReport' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
My server has the following modules and PSsnapin's
Path module pstcheck = C:\Windows\System32\WindowsPowerShell\v1.0\Modules\MailboxPSTCheck
Path module exsession = C:\Windows\System32\WindowsPowerShell\v1.0\Modules\NewExchangeSession
Get-PSSnapin -Registered
Name : Microsoft.Exchange.Management.PowerShell.E2010
PSVersion : 1.0
Description : Admin Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.PowerShell.Setup
PSVersion : 1.0
Description : Setup Tasks for the Exchange Server
Name : Microsoft.Exchange.Management.Powershell.Support
PSVersion : 1.0
Description : Support Tasks for the Exchange Server
These problems are usually the result of your program running as a 64-bit process while the snapin is registered only under 32-bit PowerShell (or vice-versa). Try changing the Platform Target of your VB project to x86. If that doesn't fix it, try x64. Ultimately, whichever version of PowerShell has the Exchange snapins registered (x64 or x86) is the platform you want to target.
I try to make a silent installation of the MS SQL 2008 R2 Management Studio Express with NSIS but I have no succeed so far.
In theory, the installer will do a silent install if I pass the /QUIET /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SSMS /ACTION=Install parameters, but it does not.
This parameters hide the general GUI, but the middle of the installation process the setup.exe will popup a cmd Window, and what is worse its write in it a "Success" text but the installation is not done at this point and if I close the cmd window, the setup process will fail.
This is the full NSIS command:
ExecWait '$OUTDIR\SQLManagementStudio_x86_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SSMS /ACTION=Install'
The SQLManagementStudio_x86_ENU.exe is downloaded from http://www.microsoft.com/en-us/download/details.aspx?id=22985
This parameter work when I try to install MS SQL Server 2008 R2
If you don't want the command window to appear replace your ExecWait with nsExec:Exec as below:
nsExec::Exec '$OUTDIR\SQLManagementStudio_x86_ENU.exe /QUIET /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SSMS /ACTION=Install'
I hope this helps.
It seems there is an undocumented parameter /hideconsole which will prevent the pop up to be appear.
The code looks like this now:
ExecDos::exec '"$OUTDIR\binary\SQLManagementStudio.exe" /hideconsole /QUIET /IACCEPTSQLSERVERLICENSETERMS /FEATURES=SSMS /ACTION=Install' "" "$OUTDIR\SQLManagementStudio.log"
You can try this set of options:
/Q /ACTION=INSTALL /IACCEPTSQLSERVERLICENSETERMS /HIDECONSOLE /Features=SSMS /INSTANCENAME=mssql2008R2 /SAPWD="sapass123" /SECURITYMODE=SQL