powershell

Powershell multiple credential setup

北慕城南 提交于 2021-01-29 04:11:35
问题 I just setup a powershell to collect disk space info among a group of servers. but I encounter an issue that while I try to authenticate from one server to another, it require different credential info. E.g. SQLServer01 ID: domain1\sqladmin1 PW: 123456 SQLServer02 ID: domain2\sqladmin2 PW: 654321 right now i manage to setup first one with limited power-shell experience. $comp= Get-Content "C:\disk_info\Computers.txt" $diskvalue = @() #$cre = get-Credential $username = "domain1\sqladmin1"

Get-FolderItem version to get all folders

那年仲夏 提交于 2021-01-29 04:05:43
问题 I have found a cmdlet that returns all files regardless of path size. I was wondering if there was an equivalent command that got all the folders regardless of path size? Get-FolderItem combines robocopy and powershell to return all files even those with the path greater than 260. Is there anyway to get all the folders in the fileshare 回答1: Get-FolderItem uses the robocopy switch /NDL to exclude directories from the log output, which it uses to grab the file info. It also avoids empty folders

Refresh Sharepoint-linked Table in Access?

做~自己de王妃 提交于 2021-01-29 03:53:25
问题 I have an access table in 2007 that is linked to a sharepoint list. When a new record is added to the sharepoint list, the change does not get automatically reflected in the access table. If you right click on the linked table, there is an option to "refresh list" which does exactly as you would expect. My question is how to perform this option programatically with powershell or something similar? (.netish) ADDITION: I have found that acCmdRefreshSharePointList exists as a way to execute the

Refresh Sharepoint-linked Table in Access?

懵懂的女人 提交于 2021-01-29 03:51:36
问题 I have an access table in 2007 that is linked to a sharepoint list. When a new record is added to the sharepoint list, the change does not get automatically reflected in the access table. If you right click on the linked table, there is an option to "refresh list" which does exactly as you would expect. My question is how to perform this option programatically with powershell or something similar? (.netish) ADDITION: I have found that acCmdRefreshSharePointList exists as a way to execute the

Build project using devenv.exe in TFS 15RC1 Build Server

大兔子大兔子 提交于 2021-01-29 03:14:31
问题 I have a trouble with understanding how to use devenv.exe from TFS Build Server. There is no default step to use devenv, so I tried to use PowerShell sсript to execute devenv.exe with parameters. There are no errors in build process but I see that build result files are not updated. If I execute the script manually on a agent-machine, the build passes successfully. That is my script: $process = [System.Diagnostics.Process]::Start( "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7

Is it possible to do swap, start, stop slots in cloud service classic, on azure devops?

给你一囗甜甜゛ 提交于 2021-01-29 03:10:42
问题 I do ci/cd to Cloud Service(classic) with azure devops . I have steps like start or stop and swap slots in this Cloud Service. I thought I can use PowerShell for these goals. In the beginning, I tried Azure PowerShell job. Unfortunately, I have not found the required commands in Az and azureRM modules. So I decided to use just PowerShell job, where I install the Azure module and I want to use these commands Start-AzureService and Stop-AzureService . Is it the right way? Or is there something

Open a word document and specify encoding with PowerShell

微笑、不失礼 提交于 2021-01-29 02:52:48
问题 I'm trying to tell PowerShell to open a text file and choose a certain encoding option. By default, when opening this text file in Word manually, it tries to open it with Japanese encoding and so doesn't show certain characters correctly. I've tried lots of different things but nothing works so I'm totally stuck. This text file, amongst others, needs to be converted to PDF on a daily basis. My current script is as follows: $wdFormatPDF = 17 $word = New-Object -ComObject Word.Application $word

Open a word document and specify encoding with PowerShell

谁说胖子不能爱 提交于 2021-01-29 02:43:52
问题 I'm trying to tell PowerShell to open a text file and choose a certain encoding option. By default, when opening this text file in Word manually, it tries to open it with Japanese encoding and so doesn't show certain characters correctly. I've tried lots of different things but nothing works so I'm totally stuck. This text file, amongst others, needs to be converted to PDF on a daily basis. My current script is as follows: $wdFormatPDF = 17 $word = New-Object -ComObject Word.Application $word

Multiple mandatory parameters in a single parameter set

倖福魔咒の 提交于 2021-01-29 02:42:17
问题 I want to achieve the following in my parameter sets: function [A | B] [C | D] (E) (F) In English as concise as possible, I would like A, B, C and D to be Manadatory=$true but A and B can't be in the same command nor can C and D. E and F will always be optional. I figured I could expand this with multiple ParameterSetName attributes following the below logic: function A C (E) (F) function A D (E) (F) function B C (E) (F) function B D (E) (F) However the below sentence says each parameter set

List AD users who do not belong to one of several groups

浪尽此生 提交于 2021-01-29 02:18:09
问题 First up, I am not a script writer, so I apologise if this sounds like a real newbie question. I am trying to write a Powershell query to list all user accounts within a certain OU sub-tree who do not belong to at least one of 4 groups. As far as I can tell you cannot query this directly on the AD User object, so you need to iterate through the groups to get the membership, but I'm not clear on how to go about this across multiple groups. I have put together a script that can find all users,