Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x

Powershell

16K

Solutions

7K

Contributors

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi all,

We utilize Exchange 2013 and are trying to setup an iPad as a replacement for a laptop in the field. However, the one hurdle we are facing is how the user can reset their password when it expires through an iPad. We do not want them locked out when they are on the road and only have the iPad.

Suggestions?
0
NFR key for Veeam Agent for Linux
LVL 1
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

hello,

we have a job every night turn on our active directory to create contacts without activate exchange contact.

so i need a script i can use with scheduled task to go in specific OU (included all sub OU) and activate exchange contact for all contact.

thanks for help
0
A user erroneously deleted ten folders containing only contacts, from the companies Public Folders mailbox. Restoring the folders with Outlook or Powershell brings the folders back.....but no contacts! After going back and forth with support over the last five days, they say that it was all permanently deleted. They claim the retention policy does not include the Public Folder mailbox and they are gone forever. I find this a bit hard to believe. I was notified by the user the same day it happened so it has only been five days now. Is Office 365's backup of PF really that weak?
0
In Outlook there is a GPO to empty deleted items with leaving Outlook.
What about Shared Mailbox : How to achieve this ?

GPO ? or PowerShell ? I did not find anything about this. (exchange 2016 on premises)

Tks.
0
I have these backup files:
Social_DB_backup_2018_01_07_071010_0794131.BAK
SharePoint_Config_backup_2018_01_07_071010_0326524.bak
BDC_Service_DB_backup_2018_01_07_071010_0482393.bak
 And so on....
I want to rename them
Social_DB_backup.bak
SharePoint_Config_backup.bak
BDC_Service_DB.bak
how can I go recursively through file directory and rename all of the backups?
Thanks!
0
Dear experts,
When I run this command and at least 2 mailboxes are found  the result is an array...

$ArrSMList = get-mailbox | Get-MailboxPermission -user $strUser | ?  {($_.AccessRights -match "FullAccess") -and -not ($_.User -like "NT AUTHORITY\SELF")} | Get-user | Select DisplayName,SamaccountName,Identity

I may ask for $arrSMList.Count or even ($I = 0 to .count)
Write-Host "$ArrSMList[$I]" + $ArrSMList[$I].DisplayName

BUT when only ONE is found NO WAY, I can't access the .Count cause this is not an array...

I would like to have EVEN IF only 1 is found  as return an array.
How can I transform this to an array if ONLY ONE is found ?

tks.
0
We are running an exchange upgrade project (exchange 2007 - Exchange 2012), 1000 users in 4 different countries, single domain, single forest.
I need assistance to find out who’s account in AD is not inheriting permissions from the parent, so it will be good to find out permissions of accounts with Inheritance enabled, vs Inheritance disabled to work out whether the differences have any impact in our environment. So I guess a power shell script can report/output this kind of information?


Thanks.
0
Hi,

I data into SQL database usage of an RDS server.
 Now I would like to show this in an HTML page, using power shell. F.e.  4 th January 8 am, 30 users, 10 am 50 users etc. then the sale for next days whole year round.
 I can create the HTML via power shell, but how to build/show the graph?

J.
0
Trying to create a List called 'Contact List' on a SharePoint site, https://mainsite.sharepoint.com/sites/Client/List/ContactList, that has a number of columns (Phone -single line of text w/ length 12, Notes - multiple lines of text, Position - managed metadata, Active -
 Yes/No, Sign Date - Date (Date Only))  and I can create the list via PowerShell PnP but I cannot create the columns no matter what I have tired.  I am using SharePoint Online and Powershell Pnp.  I cannot find one place with an example that will work.  Does anyone know of a web site of examples or have an example they can share?

Thanks,
John
0
PLEASE DELETE
0
Concerto Cloud for Software Providers & ISVs
LVL 5
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Hello experts,

I want to delegate access (for a group) to an attribute called userprincipalname, but this attribute does not show in delegate wizard in ADUC. How would I delegate/grant access.

Your assistance is appreciated.
0
Hi

We use exchange 2007 and planning  to migrate to O365 and we have a database called staffdatabase.
We have 400 staff and would like to know the mail box size of individual users.
Is there a way to find the mailbox size of every individual users.

Any tutorials will be great.
Thanks
0
Experts out there,
I am trying to run the speculationcontrol script at my desktop and  getting the following error.
I downloaded from Microsoft site and saved it in ADV180002.
I ran all those commands one at a time


PS C:\adv180002\SpeculationControl> Import-Module .\SpeculationControl.psd1
Import-Module : The 'C:\adv180002\SpeculationControl\SpeculationControl\SpeculationControl.psd1' module cannot be impor
ted because its manifest contains one or more members that are not valid. The valid manifest members are ('ModuleToProc
ess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'PowerShellVersion
', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchitecture', 'Req
uiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblies', 'ModuleLi
st', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport'). Remove the members th
at are not valid ('RootModule'), then try to import the module again.
At line:1 char:14
+ Import-Module <<<<  .\SpeculationControl
    + CategoryInfo          : InvalidData: (C:\adv180002\Sp...ionControl.psd1:String) [Import-Module], InvalidOperatio
   nException
    + FullyQualifiedErrorId : Modules_InvalidManifestMember,Microsoft.PowerShell.Commands.ImportModuleCommand
0
I am using MS exchange 2013. I have to change authentication type format from Domain\Username to only Username. When I visit at OWA of server and click on Authentication, the page is just loading. How can I fix this? Restart of IIS did not help. However, I have already made the same changes using Powershell  and same is working fine. Just facing issue with GUI only. Need assistance.

Set-owavirtualdirectory -identity "owa (default web site)" -LogonFormat UserName -DefaultDomain "<domain name>"
Error.jpg
0
hello experts
i am using powershell to start up plink.exe ssh to my network device and promote some commands, see below please.
$Plink = (${env:ProgramFiles} + "\PuTTy\plink.exe")
$commands = "d:\commands.txt"
& $Plink 192.168.18.2 -l admin -pw ******** -m $commands

and below is the content of commands.txt
conf t
int gig 0/0
shu

but i can't get it works, if you put only one command in the txt file or without -m parameter with only one command, it works, could you help me fix it and let me know what is the correct command text file format should be?

thank you
0
I have a PowerShell script that collects data from Active Directory and puts it into a nicely formatted Word Document and appends the date at the end of the file name when it is saved so I can see the different files and when they were ran.
I then run the Document Merge in Word to save the file with the differences indicated between the last two times the script ran.
***I want to automate this process.***

I don't want a third party application to do this.  I want to be able to do this with either PowerShell or VBS or a VBS called out from with in a PowerShell Script.
0
I have enabled audit logging for few mailboxes, need to know who took the mailbox ownership or accessed it with an alert mail or daily report. I tried checking the built in Non-owner mailbox report doesnt shows when i tried to take control with some test accounts. Is there any powershell script which helps to identify and alert per day or immediately.

Appreciate your help!

Note: Customer want to achieve it with native tool and no third party tool needed.
0
I'm having an issue with moving large mailboxes between two exchange 2010 servers on the same network over the wan. Many of these mailboxes are at around 50GB, exchange won't let me move them via GUI. Need to do this via power shell WITH a higher than 50 corrupt message threshold.

I'm trying to move UserA's mailbox from ServerA-DatastoreA to ServerB-DatastoreB.

Thanks!
Capture.JPG
0
So not sure if it related to Patch Tuesday or not, but after I updated my computer Powershell ISE stop working.
I have search the internet for fixes and tried them.
  1. MalwareBytes for Poweliks and nothing came up
  2. Installed PS 5.1
  3. Checked and confirmed that KB3163245 is installed, but this was well before I started to have this issue. I did uninstall it, but still having the same issue.

Any Ideas
0
Creating Active Directory Users from a Text File
LVL 7
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Hi Experts,
I am using the below to get all the DGs and the owners of the DGs. I need to export the result into an excel sheet.

$dg= get-distributiongroup


and than


foreach ($item in $dg) {"Group: " + $item.name ; Write-output "-Members-"; Get-DistributionGroupMember $item}



I tired | Export-CSV c:\DistributionGroupMembers.csv and it didn't work.

thanks in advance
0
Hi All,

I have a network share that is accessible via unc path and I can also map it as a drive using NET USE in command prompt.

However I am writing a PowerShell script that will need to map this drive as part of it and I am having problems mapping it using the New-PSDrive cmdlet.

This is the syntax that I believe should work based on what I've read online:
New-PSDrive X -PSProvider FileSystem -Root \\webserver\Logs\ -Credential $webuser

However I am receiving the below error when trying to run the command:

The specified drive root "\\webserver\Logs\" either does not exist, or it is not a folder.


I have tried with/without quotes and have included or excluded the final "\" with no luck.

Does anyone have any suggestions as to what I may be doing wrong?
0
would there be an easy way to merge the output of get-adgroupmember with some of the attributes of get-aduser? I basically need to verify a number of group members but being able to write them out to a csv type report and also pull in a number of get-aduser attributes, e.g. enabled, accountexpirydate etc would really help with this exercise.

What I am suggesting is I want to specify get-adgroupmember group, and the output be written to CSV in a table format, which of course will show all group members, but then also include some attributes about the aduser, namely attributes: enabled, email address, accountexpirydate, lastlogintimestamp. By default get-adgroupmember only returns these attributes per group member which isn't quite enough:

  • distinguisedname
  • name
  • objectclass
  • objectGUID
  • SamAccountName
  • SID

Not sure if there's anyway to amend the output of cmdlet get-adgroupmember itself to show other user attributes to avoid having to merge the output of 2 commands. I suppose I could run 2 commands and join them into something like access, but an all in one way in PowerShell would be ideal to save time.
0
$group1 = "***-***-S-U ZScaler Pilot" 
$Users = get-content 'C:\Powershell Projects\Get-viuser\user.txt'
Foreach ($user in $users) {
        Get-ADUser -identity $user -Properties memberof | where-object {$_.memberOf -notcontains $group1

Open in new window


Can anyone tell me why this doesn't work?

Thanks
Alex
0
Hi All,

I wonder if anyone here can assist me in fixing the PowerShell script below:

#################################################################################################################################################################################
# Show the list of server in the specific OU that has problem with stopped service that is set to be running as Automatic when the CPU or the Memory load of the server is > 80% 
#################################################################################################################################################################################
#

$ResultFile = "C:\TEMP\TestResult.htm"
$StartOU = "OU=Production 1,OU=Computers,DC=MyDomain,DC=com"
$ServerList = @()
$ServerList = Get-ADComputer -Properties OperatingSystem, OperatingSystemVersion, lastLogonTimestamp, lastLogon -Filter {Enabled -eq $True} -SearchBase $StartOU |
				Where-Object {Test-Connection $_.Name -Count 1 -Quiet} | 
				Select-Object -Property Name

ForEach($Computer in $ServerList) {
    $hostdns = [System.Net.DNS]::GetHostEntry($Computer) 
    $OS = Get-WmiObject Win32_OperatingSystem -ComputerName $Computer -ErrorAction Stop
    $LastBoot = [System.Management.ManagementDateTimeconverter]::ToDateTime("$((Get-WmiObject Win32_OperatingSystem -ComputerName $Computer).LastBootUpTime)")
    $Uptime = (Get-Date) - $LastBoot
	
    $propHash = [ordered]@{ 
        ComputerName = $Computer 
        BootTime     = $BootTime 
        

Open in new window

0
I want to empty all recycle bins from all the mailboxes on every saturday evening at 11:59pm.
How can I arrange this with a powershell command?

I know already to use the exshell.psc1 to schedule Exchange scripts.
0

Powershell

16K

Solutions

7K

Contributors

Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to the Component Object Model (COM) and Windows Management Instrumentation (WMI), enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and Common Information Model (CIM) enabling management of remote Linux systems and network devices.