Quantcast
Channel: /r/powershell – How to Code .NET
Browsing all 8793 articles
Browse latest View live

Error sending emojis from PowerShell

I am trying to attach emojis to people’s names in Yammer so I thought I would use PowerShell and the API to automate the process. I performed some preliminary tests using PostMan and my emojis...

View Article


Hows my Function?

first up i’m a PowerShell Noob, i know what i know from googling, never done scripting really before. My function seems to work but wanted some notes on best practices or could i have done something...

View Article


SharePoint Online: How to change Work Email?

I have to change the “Work email” for a few SharePoint Online User Profiles, and cannot find anything on google that’ll do it as a “one-liner”. Do you know of a way? This thing is driving me mad!...

View Article

New on github, a PowerShell script useful to include macros in HTML comments.

submitted by /u/Preferencesoft [link] [comments] The post New on github, a PowerShell script useful to include macros in HTML comments. appeared first on How to Code .NET.

View Article

PowerShell Classes Part 2 – Enumerated Types

submitted by /u/darklightedge [link] [comments] The post PowerShell Classes Part 2 – Enumerated Types appeared first on How to Code .NET.

View Article


New-PSSession not working as expected in called script.

My intention is to use New-PSSession as a test for whether I can run some command line commands on a remote machine. foreach($vm in $vms) { $sess = New-PSSession $vm.Name #check that WSMAN connection...

View Article

Replace text in a string

Hi everyone, first time posting here and thanks in advance for any help! I’m trying to stop all processes from any domain (YNET) user, except for “tsprogressui”. What I have so far that works is:...

View Article

Logoff all users except current logged in

This code logs off the current user as well and I don’t know why… query session | where-object {($_ -notmatch 'console') -and ($_ -match 'disc') -and ($_ -notmatch 'services')} | logoff submitted by...

View Article


is jenkins the right tool?

I want to take our powershell scripts and allow our Tier 1 support to run the scripts. But our Tier 1 doesn’t have the rights to perform the functions the scripts are created to do. I want jenkins to...

View Article


Powershell to open sql file in SSMS

I have a GUI interface to my powershell scripts so that the people using them just have to select the name of the script from a dropdown and either click the about or run buttons to do what they want....

View Article

Automating the new user process with Powershell scripting

Hello everyone. Looking for a hand, maybe some of you have had experience with this. Background: We’re a Windows and Office365. When we create new users, most of the time it’s with a mirror of an...

View Article

[Help] Getting Unique IPs foreach line

Hi Everyone, Quick question, I have a text file which has two or more IP in each line. I want to just one of the IP per line. I can see it on my head but I’m stuck. so here’s what my text is. {Gateway...

View Article

Looking to move multiple computer accounts from multiple OU’s to a new OU

Like the title says. What I’m trying to accomplish is moving all of our old XP machines to a single OU. I’m at a new company that has a bunch of left over computer accounts and I’m cleaning up our AD...

View Article


Sorting variable data into other variables

Powershell rookie here so please bear with me. I got a variable containing a bunch of different Attributes like: PS C:Windowssystem32> $vmAttributes.name 2008R2Std MSSQL 2008 Web Uptime 1 RDS...

View Article

Back at it again… finding temp folder size of all servers in an OU..

I have the following code that does nothing when ran. Code GOAL: Right now I want it to just return a list of servers in an OU that have a temp folder greater than 500 MB. I eventually want to have it...

View Article


Possible to disable command?

Greetings. Malware creators have started to use powershell quite a lot it seems. While it would be best to prevent Malware from entering the network entirely, it can happen anyway. If you find out...

View Article

Need to search / export all calendar appointments for a mailbox user

i found a script [(https://code.msdn.microsoft.com/exchange/PowerShellEWS-Search-e0f9c169)] that appears to do it, but i am note getting any data returned, it appears to run but goes insanely quick...

View Article


Monitoring folder and subfolders, then run an action.

Totally new to powershell. I’ve been looking for away to monitor a folder along with it’s sub-folders. I think FileSystemWatcher is what I need. The next part is where I’m struggling, I need the...

View Article

New user O365, include and add license

Hello, I am new to Powershell scripting and would like to figure out how to add a new mailbox and assign a license. I managed to add the mailbox from the CSV using pastebin:...

View Article

Get-content and Windows forms

I’m a beginner. I would like to have a user choose text file from windows explorer instead of typing in a file path and get the text file contents. I found this: Function...

View Article
Browsing all 8793 articles
Browse latest View live


Latest Images