Quantcast
Channel: Windows PowerShell forum
Viewing all 21975 articles
Browse latest View live

file download using PowerShell (e.g. some GBs)

$
0
0

Hello Guys,

I would like to know wheter are there any (efficent) solution to download big files (e.g. ~GB) from remote computer using PowerShell?

I found severel file uploader PS scripts, but in this case this is not the good way for me.

I didn't find the correct PS method. I used the Invoke-Method to recive the chunked content from remote computer, but it was really slow. (e.g. receive a chunk (0.01 MB) ~2 sec on my local computer)

Construction:

1.)Open the remote session and the file stream

2.)Get Chunked file pieces based on chunkSize

3.)Close the remote file stream in the session

Here is my sample:

$chunksize = 0.01MB
$piece = Invoke-Command -session $Session -scriptblock {
		param($sizeofchunk)
		try
		{
			[byte[]]$contentchunk = New-Object byte[] $sizeofchunk
			$filestream.Read($contentchunk, 0, $sizeofchunk )
			return $contentchunk
		}
			catch
		{
			write-error "could't read file:" $_.exception.tostring()
				return 0
		}
 } -argumentlist $chunksize

Thank you for your help,

Viktor



Find which groups in an OU have permissions to reset passwords

$
0
0

I've been all over the Google machine trying to find an answer to my question, but inevitably, the only search results that come up are for delegating password reset rights or using pre-written tools, which is problematic due to my workplace's stance on untested software. 

All I want to do is search within a specific OU (let's call it People) to find out which groups have the Reset Password permission set to Allow. I then want to output this file to text or .csv. I work with a lot of domains, so the GUI way is out. I'm a PS newb, so please, Obi Wan, you're my only hope. 

Thank you!

Powershell | Query a Hash Table

$
0
0

So without really thinking too much about it I decided to take a three column set of data and toss it in a hash table. I used this code to do so: 

$StateIDTable = @()
$NewStateIDRow = new-object psobject
$NewStateIDRow | add-member noteproperty TopicTypeID ("300")
$NewStateIDRow | add-member noteproperty StateID ("0")
$NewStateIDRow | add-member noteproperty Description ("Compliance state unknown")
$StateIDTable += $NewStateIDRow
$NewStateIDRow = new-object psobject
$NewStateIDRow | add-member noteproperty TopicTypeID ("300")
$NewStateIDRow | add-member noteproperty StateID ("1")
$NewStateIDRow | add-member noteproperty Description ("Compliant")
$StateIDTable += $NewStateIDRow

Which creates a Table that with TopicID's, StateID's, and Descriptions. (note, the real table has 30 entries I just put the code for two of them for example). My goal was then to be able to query this table on the fly against a set of logs. 

For example I wanted to be able to tell that a given log entry from WMI was "compliance state unknown" by asking the Hash Table what the Description was for TypeID 300 and StateID 0. In SQL I would do:

Select Description from HashTable Where TopicTypeID = 300 and StateID = 1

So is it possible to get this flexibility out of a hash table or am I out of luck? Hoping for something optimized as there can be alot of logs to go through.

Thanks in advance! 

-Eric

a positional parameter cannot be found

$
0
0

I can run the following script with no errors from inside the ISE, however when i save the final and run with powershell from the desktop I get the following error(currently i used cd to change directories, i also tried set-location, got the same results): 

set-location: A positional parameter cannot be found that accepts argument 'Monthly'

At C:\Users\haxxxx\Desktop\gregreport.ps1:20 char:1

+ set-location -path

\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR

+category info : invalid arguement: (:) set-location, parameterbinding expcetion

+fullyqualifiederrorid : positionalparameternotfound, Microsoft.powershell.commands.setlocationcommand

#get user input and create new folder based on input
$folder = read-host -Prompt 'What month is this for? use (yyyy-mm)' 
new-item "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$folder Monthly Hierarchy" -type directory
new-item "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$folder Current Hierarchy" -type directory
cls

#store user input into new variable
$newfolder = $folder + ' '+ 'Monthly Hierarchy'
$newfolder2 = $folder + ' '+ 'Current Hierarchy'

#gets all files containing name "current", has file ext .tif and moves to user specified folder
get-childitem "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\" -filter *current*.tif | Move-Item -Destination "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$newfolder2" 
get-childitem "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\" -filter *.tif | Move-Item -Destination "\\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$newfolder" 

#calls 7zip to compress the folders
cd \\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$newfolder\
7za.exe a -tzip $newfolder'.zip'
cls

cd \\ken-prod-fsXXX\department\IT\IT_Associate_Software\Feeds\AR Monthly Trend\$newfolder2\
7za.exe a -tzip $newfolder2'.zip'
cls

thanks for assisting

Validate a numeric entry

$
0
0

So I have a script menu that has a list of all the company sites. These are numbered 1-39 for AM, 51-67 for EMEA and 76-90 for APAC.  I ask the user to enter the # corresponding to the site they want.

I'm trying to put validation into the script to make sure they enter a correct number.  So far I have the following:

$office = read-Host "Please enter an office #"

if (-not((($office -gt 0) -and ($office -lt 40)) -or (($office -gt 50) -and ($office -lt 68)) -or (($office -gt 75) -and ($office -lt 91)) -or ($office -eq 4) -or ($office -eq 5) -or ($office -eq 6) -or ($office -eq 7) -or ($office -eq 8) -or ($office -eq 9)))
{
Write-Host "`nYou did not enter a valid option`n" -ForegroundColor Red
Write-Host -NoNewLine 'Press any key to continue...' -ForegroundColor yellow
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')

.\validation.ps1
}
else
{
Write-Host "`nYou did enter a valid option`n" -ForegroundColor green
Write-Host -NoNewLine 'Press any key to continue...' -ForegroundColor yellow
$null = $Host.UI.RawUI.ReadKey('NoEcho,IncludeKeyDown')

.\validation.ps1
}

This code works fine for non-numeric text and for numbers in between the groups (40-50, etc).  But if I enter something like 324 or other 3 digit or larger numbers, it tells me it's a valid option.  How can I make sure that it doesn't accept anything larger than 90?

Also, as you can see, I'm specifying numbers 5-9.  It seems like powershell doesn't like those particular digits unless you include them specifically.  Is there something I'm missing?

And I'm more than open to other options if there's an easier way.

Send output to a Zebra label printer

$
0
0

Hello, I am trying to get Powershell to send output to a Zebra LP 2824 Plus label printer, and I'm not having much luck and I'm beginning to wonder if Out-Printer is only intended to send output to standard letter sized paper.  The labels I am using are 2.25" x 4" (portrait), and it seems like powershell is adding a static margin size of 1" on all sides of the label, which means I only end up with 1/4" of printable area on the label.  I tried testing with a Dymo label printer as well, and ended up with the same result.  A coworker was able to change the Zebra printer to line printing mode via telnet, which gave me use of the entire label (1/8" margins, at the most), but anytime I send output to it, it just spits out jibberish. I have also confirmed via a windows test page that the printer is capable of printing properly, the problems just seem to point to Powershell.

Here's the command I am sending (the object in $hostname is a string, if it matters):

    $hostname | Out-Printer -Name ZebraLP2824Plus

Has anyone tried sending output to a label printer, and if you were successful, can you share some advice?

Thanks in advance.

Powershell - OU permission delegation using powershell

$
0
0

Hi Experts,

I want to apply Deny permission for a group on an OU like below screenshot using powershell


Now i found below blog is helpful. but i'm not getting correct ActiveDirectoryAccessRule to apply.
http://blogs.technet.com/b/joec/archive/2013/04/25/active-directory-delegation-via-powershell.aspx#pi142453=2

----

Using below code i can apply Deny the group to write all properties of descendant user objects. 
But i want to Deny the group "write all properties" & "Modify permissions" ofThis object only

Import-Module ActiveDirectory
$rootdse = Get-ADRootDSE
$domain = Get-ADDomain


$guidmap = @{ }
Get-ADObject -SearchBase ($rootdse.SchemaNamingContext) -LDAPFilter '0(schemaidguid=*)' -Properties lDAPDisplayName, schemaIDGUID |
	ForEach-Object{
		$guidmap[$_.lDAPDisplayName] = [System.GUID]$_.schemaIDGUID
	}

$extendedrightsmap = @{ }
Get-ADObject -SearchBase $rootdse.ConfigurationNamingContext -LDAPFilter '(&(objectclass=controlAccessRight)(rightsguid=*))' -Properties displayName, rightsGuid |
ForEach-Object{
	$extendedrightsmap[$_.displayName] = [System.GUID]$_.rightsGuid
}


$ou = Get-ADOrganizationalUnit -Identity 'OU=Users,DC=AMERICAS,DC=TEST'
$sid=(Get-ADGroup "Nidhin-Test-Group").SID
$p = New-Object System.Security.Principal.SecurityIdentifier($sid)
$acl = Get-ACL -Path $ou.DistinguishedName

$ace=New-Object System.DirectoryServices.ActiveDirectoryAccessRule($p, 'WriteProperty', 'Deny', 'Descendents', $guidmap['user'])
$acl.AddAccessRule($ace)
Set-ACL "LDAP://$($ou.DistinguishedName)"

Regards, Nidhin.CK


Module Manifest DotNetFrameworkVersion key

$
0
0

Hello,

I've developed a module using .NET 4.5 and I'm trying to use the DotNetFrameworkVersion key in the module manifest but it does not seem to be working.

For example, I set the value to "4.5" and I then import the module without problems. The same with "7.1" even though there is no such version.

Do I have to enable something else on the manifest?

Thank you,

Christos


how to set the secondary mailbox for a user ?

$
0
0

how to set the  mailbox for a user using powershell ?

the user's reply-to address must be user1@contoso.com, and the email address user1@contoso.onmicrosoft.com function as a secondary email address for the user

thanks

Powershell.exe -version syntax just wont work stays at 4.0)

$
0
0

Hi,

Has anyone seen this before? "powershell.exe -version 2" does not enter v2 mode. 

Windows Server 2008 R2 SP1
Exchange 2010 SP3
WMF4

PS C:\Windows> $psversiontable

Name                           Value
----                           -----
PSVersion                      4.0
WSManStackVersion              3.0
SerializationVersion           1.1.0.1
CLRVersion                     4.0.30319.34209
BuildVersion                   6.3.9600.16406
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}
PSRemotingProtocolVersion      2.2

powershell.exe -version 2 

PS C:\Windows> powershell -v 2
Windows PowerShell
Copyright (C) 2013 Microsoft Corporation. All rights reserved.

PS C:\Windows> get-host

Name             : ConsoleHost
Version          : 4.0


Backup software required PS v3 so we cannot roll back. But why won't -version command let us use v2 on 2008r2? Server 2012 accept this perfectly.

Best regards,

Chris

Can't add / character in registry

$
0
0
Import-CSV addregistrykey.csv | ForEach-Object{
New-Item -Path $_.registryPath -Name $_.pathName -Force | Out-Null
New-ItemProperty -Path $_.extendedPath -Name $_.keyName -Value $_.keyValue -PropertyType $_.keyType -Force | Out-Null
Get-ItemProperty -Path $_.extendedPath -Name $_.keyName
}

The csv as below. Problem in adding / in "RC4 128/128"

registryPath,pathName,extendedPath,keyName,keyType,keyValue
HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0,Server,HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server,Enabled,DWORD,0
HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0,Server,HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server,Enabled,DWORD,0
"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers","RC4 128$([char]0x2215)128","HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 128$([char]0x2215)128",Enabled,DWORD,0
"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers","RC4 40$([char]0x2215)128","HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 40$([char]0x2215)128",Enabled,DWORD,0
"HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers","RC4 56$([char]0x2215)128","HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Ciphers\RC4 56$([char]0x2215)128",Enabled,DWORD,0
HKLM:\System\CurrentControlSet\Services\LanmanServer,Parameters,HKLM:\System\CurrentControlSet\Services\LanmanServer\Parameters,RequireSecuritySignature,DWORD,1

Script debug error

$
0
0

Hi ,

I am trying to run the following PowerShell script and getting errors as shown right below the script, can someone help me to fix the errors

Pasting part of script where I am getting error lines... due to character limitation

Script:


function

GetInfoApplications{

  

   

foreach($ApplicationinGet-CMApplication) {

       

$AppMgmt=([xml]$Application.SDMPackageXML).AppMgmtDigest

       

$AppName=$AppMgmt.Application.DisplayInfo.FirstChild.Title

       

foreach($DeploymentTypein$AppMgmt.DeploymentType) {

           

# Calculate Size and convert to MB


            

$size=0


           

foreach($MyFilein$DeploymentType.Installer.Contents.Content.File) {

               

$size+=[int]($MyFile.GetAttribute("Size"))

            }

           

$size=[math]::truncate($size/1MB)

           

# Fill properties


           

$AppData=@{           

AppName

=$AppName


                Location          

=$DeploymentType.Installer.Contents.Content.Location

                DeploymentTypeName

=$DeploymentType.Title.InnerText

                Technology        

=$DeploymentType.Installer.Technology

ContentId

=$DeploymentType.Installer.Contents.Content.ContentId

         

                SizeMB            

=$size


             }                          

           

# Create object


           

$Object=New-ObjectPSObject-Property$AppData


   

           

# Return it


           

$Object


        }

    }

}



# Get the Data



Write-host

"Applications"-ForegroundColorYellow


GetInfoApplications

|select-objectAppName,Location,Technology|Format-Table-AutoSize 

Error:

At line:126 char:53

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                     ~

Missing ')' in method call.

At line:126 char:53

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                     ~

Unexpected token '&' in expression or statement.

At line:126 char:53

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                     ~

Missing closing ')' in expression.

At line:126 char:63

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                               ~

The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double quotation marks

("&") to pass it as part of a string.

At line:125 char:82

+ ... .Content.File) {

+                    ~

Missing closing '}' in statement block.

At line:121 char:62

+         foreach ($DeploymentType in $AppMgmt.DeploymentType) {

+                                                              ~

Missing closing '}' in statement block.

At line:116 char:49

+     foreach ($Application in Get-CMApplication) {

+                                                 ~

Missing closing '}' in statement block.

At line:114 char:1

+ {

+ ~

Missing closing '}' in statement block.

At line:126 char:69

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                                     ~

Unexpected token ')' in expression or statement.

At line:126 char:70

+                 $size += [int]($MyFile.GetAttribute("Size"))

+                                                                      ~

Unexpected token ')' in expression or statement.

Not all parse errors were reported.  Correct the reported errors and try again.

    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException

    + FullyQualifiedErrorId : MissingEndParenthesisInMethodCall

Script to enable Litigation Hold and give Archiveoneadmin full access

$
0
0

Below are the two commands which I am trying to script so that they read email address from csv file and  enable Litigation Hold and give Archiveoneadmin full access to Office 365 mailbox.

Set-Mailbox -Identity ABeeunas@Daymon.com -LitigationHoldEnabled $true

Add-MailboxPermission -Identity ABeeunas@Daymon.com -User archiveoneadmin@daymon.com -AccessRights FullAccess

Following is my script which is not working

#Connect to Exchnage Online

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session

#Enable Litigation Hold using cvs file and give Archiveoneadmin full access

$Users=Import-CSV C:\scripts\LitUsers.csv
$Users | ForEach-Object {
Set-Mailbox -Identity $_.EmailAddress -LitigationHoldEnabled $true
Add-MailboxPermission -Identity $_.EmailAddress -User archiveoneadmin@daymon.com -AccessRights FullAccess}

}

When I run the script:
Cannot bind argument to parameter 'Identity' because it is null.
    + CategoryInfo          : InvalidData: (:) [Set-Mailbox], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Set-Mailbox
    + PSComputerName        : outlook.office365.com

Can someone please assist?

Format-Volume of GPTTYPE {c12a7328-f81f-11d2-ba4b-00a0c93ec93b} fails

$
0
0

PS X:\> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1

Format-Volume : No matching MSFT_Volume objects found by CIM query for enumerating instances of the
ROOT/Microsoft/Windows/Storage/MSFT_Volume class on the  CIM server, that are associated with the following instance:
MSFT_Partition (DiskId = "\\?\scsi#disk&ven_corsair&prod_cssd-f12..., Offset = 403701760). Verify query parameters and
retry.
At line:1 char:1
+ Format-Volume -FileSystem FAT32 -Partition $Partition2 -Confirm:$false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (MSFT_Volume:String) [Format-Volume], CimJobException
    + FullyQualifiedErrorId : CmdletizationQuery_NotFound,Format-Volume

CODE:

-------

New-Partition -DiskNumber 0 -Size 260MB -GptType '{c12a7328-f81f-11d2-ba4b-00a0c93ec93b}'
$Partition2 = Get-Partition -DiskNumber 0 -PartitionNumber 2
Set-Partition -NewDriveLetter S -InputObject $Partition2
Format-Volume -FileSystem FAT32 -Partition $Partition2 -Confirm:$false

Change from gpt type PARTITION_SYSTEM_GUID to PARTITION_BASIC_DATA_GUID or PARTITION_MSFT_RECOVERY_GUID works ok for format, but looses 'system' reservation.

Only apparent way to fix this is by setting PARTITION_BASIC_DATA_GUID and then via DISKPART SET ID...

I've tried several ways to pass a valid input parameter through to -Partition for Format-Volume, but it keeps trying to interpret it as an InputObject of type Volume.  It's impossible to get a Volume Object for the new partition when it doesn't exist yet, but Format-Volume is refusing to accept this partition gpt type as valid input.

Disable windows powershell event logging

$
0
0

I'm using PsExec to run PowerShell scripts on remote machines and as a side effect of this, the "Windows PowerShell" event-log (found in the Event Viewer under "Applications and Services Logs") is logging all of our arguments to the script under "HostApplication". This is a problem because some of these arguments contain sensitive passwords.

I've tried setting the preference variables listed below to false but it will still create logs when the PowerShell engine starts. From what I've read this is because PowerShell creates these logs before it even checks the value of these preference variables.

$LogEngineLifeCycleEvent=$false;
$LogEngineHealthEvent=$false;
$LogProviderLifeCycleEvent=$false;
$LogProviderHealthEvent=$false;

Our current solution uses these preference variables in combination with putting the following line at the beginning of each of our PowerShell scripts to make sure that the logs created when the PowerShell engine starts are wiped away.

Clear-EventLog "Windows PowerShell";

This solution is ok, but I'd like to get it to a point where our passwords are never being saved in the log and the log never needs to be cleared. Is there any way to disable PowerShell logging so that events won't be created at ANY point in the PowerShell engine life cycle?


Unable to launch PowerShell ISE

$
0
0

Hello,

One of our client is using Windows 2008 R2 where the PowerShell ISE feature is installed.He is unable to launch the Powershell application when he logs in using a service account.

Could you please share your thoughts on this.

Thanks in anticipation.

How to set the IP address for (same as parent) record in DNS using Set-DnsServerResourceRecord

$
0
0

I need to re-IP a bunch of servers in a datacenter move and am using PowerShell to update the records in DNS.  I am having a problem with changing the (same as parent) or @ A record.  The Set-DnsServerResourceRecord cmdlet I'm using does not work for this A record:

The property 'ipv4address' cannot be found on this object. Verify that the property exists and can be set.
At C:\Users\twalters.admin\Documents\UpdateDNSARecords.ps1:15 char:5
+     $newobj.recorddata.ipv4address=[System.Net.IPAddress]::parse($updateip)
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException

Here is the script I am using to set the address:

Import-csv C:\users\twalters.admin\DNSTest2.csv | foreach-object -Process{
    $oldobj = get-dnsserverresourcerecord -name $_.hostname -zonename $_.Zonename -rrtype "A"
    $newobj = get-dnsserverresourcerecord -name $_.hostname -zonename $_.ZoneName -rrtype "A"
    # set the following lines input variable to OrigAddress or NewAddress, depending on change desired
    # $updateip = $_.NewAddress
    $updateip = $_.OrigAddress
    write-host $_.HostName " ----> " $newobj.HostName
    write-host $newobj.RecordData.IPv4Address
    $newobj.recorddata.ipv4address=[System.Net.IPAddress]::parse($updateip)
    write-host $newobj.RecordData.IPv4Address
    Set-DnsServerResourceRecord -NewInputObject $newobj -OldInputObject $oldobj -ZoneName $_.ZoneName -passthru
}

Input csv looks like:

ZoneName,HostName,RecordType,OrigAddress,NewAddress
testing.test,@,A,192.168.35.48,10.9.7.100

This script works well for every other A record.  I have tried passing the following as the name (hostname field imported from the csv file):

@
"@"
'@'
.
"."
'.'

Nothing I've tried works.  Getting frustrated and running out of time!

TIA

Powershell keeps hanging apparently because no internet access

$
0
0
So, I installed PS5 (on Win7x64) and along with it came PSGallery etc and NuGet, got that all going OK. However, at work I generally have a couple PS instances open, one with my normal credentials, one with domain-admin.

The domain-admin account of course has no internet access. But since I installed this, it takes a long time for PS to start, and procmon shows lines such as:

mypc:56459 -> a23-195-51-28.deploy.static.akamaitechnologies.com:https

That has to wait to timeout. Also, certain commands or maybe it's on a schedule, seem to trigger a check as well.

How do I disable this? I can install any packages or update them from my normal account - I don't need every session, some of which have no internet access, to be doing this as well.

Version          : 5.0.10514.6
Name                      : PSGallery
SourceLocation            : https://go.microsoft.com/fwlink/?LinkID=397631&clcid=0x409
Trusted                   : False
Registered                : True
InstallationPolicy        : Untrusted
PackageManagementProvider : NuGet
PublishLocation           : https://go.microsoft.com/fwlink/?LinkID=397527&clcid=0x409
ProviderOptions           : {}

Name                     Version
----                     -------
NuGet                    2.8.5.127
Programs                 10.0.10514.6
msu                      10.0.10514.6
msi                      10.0.10514.6
PSModule                 1.0.0.0

Remove domain in EOP powershell to capture and remove all users associated

$
0
0

I have the following -

 Get-user | where {$_.userprincipalname -like "*domain.com"
} | Remove-mailuser

However when the remove portion runs each generates an error the user is not within a valid server write scope.  How can I addresss this? 


Frank

Orchestrator Match Pattern

$
0
0
Hopefully, this is the correct forum for this.  I am using a data manipulation task in Orchestrator to parse a large block of text and extract only the URL I need.  There are <> on the ends of the URL.  I'm using https://*.*[^>] but this does not exclude the trailing > that I need to remove.  Any ideas as to why that is?

Best, Jacob I'm a PC.

Viewing all 21975 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>