powershell

Windows Server 2012 之DirectAccess:快速部署功能

 ̄綄美尐妖づ 提交于 2020-12-31 14:13:41
在Windows Server 2012中部署DirectAccess时,有两种不同形式的部署场景:快速安装和高级配置。从较高角度来看,这两种场景的区别请参见下表: 今天我将利用第一种方式“快速安装”来部署一台远程访问服务器,并测试客户端的连接性。 利用“快速安装”部署的DirectAccess服务器,只支持Windows8客户端的连接。 在前面几篇的环境部署中,已经部署好了基本的网络环境,但在今天的环境中,EDGE1服务器只需要一个公网IP,网络拓扑结构如下图 1. 创建一台运行Windows 8 的虚拟机,命名为CLIENT1,并且加入contoso.com域(步骤略) 2. 在DC1中创建一个用户组DirectAccess Clients,并将CLIENT1添加到该组中 3. 在EDGE1服务器上安装远程访问功能 选择远程访问角色 添加所需的功能 功能选项,保持默认 下一步 远程访问角色服务,保持默认,下一步 确认安装内容后,开始安装 安装完成 4. 配置远程访问功能(DirectAccess) 打开开始向导 选择仅部署DirectAccess 网络拓扑结构选择边缘,输入远程访问服务器公用名称edge1.test.com(就是我在前面环境部署中设置好的模拟公网域名,指向的edge1服务器的公网网卡IP) 在这里,先不要急着点击完成

Powershell try block not working on VSTS build

核能气质少年 提交于 2020-12-31 10:53:33
问题 I'm running a command in Powershell through VSTS to affect Azure. The command works, but it gives an error after. The params and connection are working as evidenced by the fact that the group gets permission from the command. I figure a workaround is to put the command in a try block, have it run, and then when the error comes up go to the catch block and end without throwing the error. When I run this script, I still get the same error, like the try block is ignored. Do I have the syntax

Powershell try block not working on VSTS build

随声附和 提交于 2020-12-31 10:52:24
问题 I'm running a command in Powershell through VSTS to affect Azure. The command works, but it gives an error after. The params and connection are working as evidenced by the fact that the group gets permission from the command. I figure a workaround is to put the command in a try block, have it run, and then when the error comes up go to the catch block and end without throwing the error. When I run this script, I still get the same error, like the try block is ignored. Do I have the syntax

Powershell try block not working on VSTS build

佐手、 提交于 2020-12-31 10:50:36
问题 I'm running a command in Powershell through VSTS to affect Azure. The command works, but it gives an error after. The params and connection are working as evidenced by the fact that the group gets permission from the command. I figure a workaround is to put the command in a try block, have it run, and then when the error comes up go to the catch block and end without throwing the error. When I run this script, I still get the same error, like the try block is ignored. Do I have the syntax

Is it possible authenticate both Connect-AzAccount and Connect-AzureAD using MFA with a single user login prompt?

时光总嘲笑我的痴心妄想 提交于 2020-12-31 06:30:30
问题 I set up a visual studio project template that runs setup scripts to automatically register an application and create application insights for the app. The problem is the app registration uses the AzureAD module while the application insights (and the resource group creation if needed) use the Az modules, so I end up needing to do Connect-AzAccount Connect-AzureAD Which prompts the user for their login twice. Is there a way to use the auth from one to authenticate the other? I've seen similar

Is it possible authenticate both Connect-AzAccount and Connect-AzureAD using MFA with a single user login prompt?

ぐ巨炮叔叔 提交于 2020-12-31 06:30:23
问题 I set up a visual studio project template that runs setup scripts to automatically register an application and create application insights for the app. The problem is the app registration uses the AzureAD module while the application insights (and the resource group creation if needed) use the Az modules, so I end up needing to do Connect-AzAccount Connect-AzureAD Which prompts the user for their login twice. Is there a way to use the auth from one to authenticate the other? I've seen similar

How to determine if my PowerShell script is being executed by Windows Terminal?

落爺英雄遲暮 提交于 2020-12-31 05:51:36
问题 I want to do something special when my PowerShell script is being executed by Windows Terminal and not the normal PowerShell command line or ISE. How to determine that? I checked some built-in variables like $Host and can't find related information. 回答1: Disclaimer: Windows Terminal is still in development at this time of writing and this information could change for the stable release. Look for the $env:WT_SESSION environment variable - this looks to be set to a GUID in a Windows Terminal

How to determine if my PowerShell script is being executed by Windows Terminal?

a 夏天 提交于 2020-12-31 05:49:00
问题 I want to do something special when my PowerShell script is being executed by Windows Terminal and not the normal PowerShell command line or ISE. How to determine that? I checked some built-in variables like $Host and can't find related information. 回答1: Disclaimer: Windows Terminal is still in development at this time of writing and this information could change for the stable release. Look for the $env:WT_SESSION environment variable - this looks to be set to a GUID in a Windows Terminal

How to determine if my PowerShell script is being executed by Windows Terminal?

故事扮演 提交于 2020-12-31 05:46:53
问题 I want to do something special when my PowerShell script is being executed by Windows Terminal and not the normal PowerShell command line or ISE. How to determine that? I checked some built-in variables like $Host and can't find related information. 回答1: Disclaimer: Windows Terminal is still in development at this time of writing and this information could change for the stable release. Look for the $env:WT_SESSION environment variable - this looks to be set to a GUID in a Windows Terminal

How to get the index of the last occurence of a char in PowerShell string?

穿精又带淫゛_ 提交于 2020-12-31 04:43:45
问题 I want to get the index of the last "\" occurrence in order to trim the "Activity" word and keep it, from following string in PowerShell: $string = "C:\cmb_Trops\TAX\Auto\Activity" I'm converting the code from VBScript to PowerShell and in VB there's this solution : Right(string, Len(string) - InStrRev(string, "\")) Using Right and InStrRev functions which makes the life more easier. Unfortunately I didn't find anything like it in PowerShell. Can't find any option to scan from the end of the