With all Microsoft Active Directory Module for PowerShell, it doesn’t have an cmdlet to simply search a user or group in AD to find it exists or not. Get-ADUser or Get-ADGroup spits an ugly error message if it doesn’t find the object. I wrote an PowerShell function to do exactly what I wanted. Simple search … Continue reading Find a user (or any object) exists in Active Directory
Author: --Anand--
PowerShell: Check the user is member of a Group (including Built-in Groups)
The issue with Get-ADUser JohnDoe –Properties MemberOf cmdlet is it doesn’t list Domain Built-in groups like Domain Users. I am not sure why Microsoft wants to hide built-in groups from listing user group memberships. So I have written a VB Script style function. To use this function, copy & paste this function to your PowerShell … Continue reading PowerShell: Check the user is member of a Group (including Built-in Groups)
IIS: Publish Windows Share to WebDAV site
Publishing local folders as WebDAV site is very easy with IIS. There is plenty of help available that. BUT there is not much help on publishing a Windows share via WebDAV. So I decided to publish one after we successfully published it at my work. It works beautifully. One Liner: The trick is to replace … Continue reading IIS: Publish Windows Share to WebDAV site
RDS 2012R2/Profile Disk: Adobe Reader X says “There was an error opening this document. Access Denied”
PDF attachments from application is not opening correctly. Adobe Reader spits this error message. We use RDS 2012 R2 and Profile Disks for the users. Somehow PDF files on the profile disk is having same issue with Adobe Reader. Solution: It turn out to be new Adobe Reader software has Protected Mode feature. This feature … Continue reading RDS 2012R2/Profile Disk: Adobe Reader X says “There was an error opening this document. Access Denied”
PowerShell: List everything on a OU in a one line
To list all users in a OU, we can get it using Get-ADUser cmdlet. See the example below. (replace OU path in LDAP format to your own stuff and "Import-Module ActiveDirectory" before you run it). Get-ADUser -Filter * -SearchBase "cn=Users,dc=company,,dc=com" -properties title, department| Select-Object name,title,department Now what if you want everything (Users, Groups, Contacts, etc.,) … Continue reading PowerShell: List everything on a OU in a one line
Excel: Paste multi-line text into a cell
If you copy and paste multi-line text into a Excel cell, Excel pastes into multi-row or multi-column data. This blog tip is to show how to paste a text into a cell and preserve the tabs and paragraphs into the same cell. Solution: 1. Copy your multi-line text (Control-C) 2. On Excel, Select the cell … Continue reading Excel: Paste multi-line text into a cell
Security Warning: The current web page is trying to open a site in your Trusted sites list.
If you are getting this message, you are messing with IE Security settings and missed one. Solution: Open Internet Explorer Select Tools – Internet Options Select Security Tab – Trusted Sites – Custom Level Find the setting Websites in less privileged web content zone can navigate into this zone and Enable this setting.
PowerShell: How to return multiple values from a Function?
If you like to return multiple values from a function, simply populate a hash table variable in function and return the variable. See my example below. Feel free to use my example function and Enjoy. Function Get-UserInfo($username) { #Create an hashtable variable [hashtable]$Return = @{} Import-Module ActiveDirectory $ADUser = … Continue reading PowerShell: How to return multiple values from a Function?
Make sure the virtual machine’s configuration allows the guest to open host applications
If you see this error on a RDS or Citrix published application, Session host/XenApp server is messed up with file associations. I was trying to open a link to a site in RDS session. That means Internet Explorer is not default program to handle the links or HTM/HTML files. Solution: Remote Desktop to the Session … Continue reading Make sure the virtual machine’s configuration allows the guest to open host applications
Windows 8.1: Where the heck is Start-up folder?
Microsoft ditched the start-menu in Windows 8. I get that. BUT we used to get to the start-up folder using start-menu, so we can place few shortcuts to start automatically when we log in. How the hell am I going to find it in the GUI? No where. I searching around and found where the … Continue reading Windows 8.1: Where the heck is Start-up folder?