Skip to content

Instantly share code, notes, and snippets.

@IsmaelJCarlo
IsmaelJCarlo / confluence-macro-yammer-group-newsfeed.html
Created April 14, 2016 22:03
A user macro for Confluence that allows you to embed a Yammer Group Newsfeed
## Macro title: Borderless Table
## Macro has a body: Y
## Body processing: Selected body processing option
## Output: Selected output option
## Developed by: Ismael Carlo
## Date created: 03/17/2016
## Installed by: Ismael Carlo
## Yammer Group Newsfeed
## @param FeedId:title=FeedId|type=string|required=true|desc=Enter the Feed ID. You get this from the Group URL in Yammer. For more information look at the documentation.
## @param Height:title=Height|required=true|desc=The height of your Yammer window in the following format: ###px (Example: 400px)
@IsmaelJCarlo
IsmaelJCarlo / Enable-Run-As-User.ps1
Created January 18, 2016 22:32
Enable-Run-As-User
<#
.SYNOPSIS
Enables Run as a Different User in Windows 10
.EXAMPLE
Enable-Run-As-User.ps1
.Description
Written by Ismael Carlo 1/18/2015
Script based on: http://blogs.technet.com/b/heyscriptingguy/archive/2015/04/02/update-or-add-registry-key-value-with-powershell.aspx
#>
@IsmaelJCarlo
IsmaelJCarlo / running_processes.sql
Created February 6, 2015 15:09
T-SQL Running Processes
----------------------------------------------------------------
--- SQL 2000 What's running now query
-- DBCC TRACEON (2861) -- enables caching of zero cost plans
-- DBCC TRACEOFF (2861); DBCC FREEPROCCACHE -- disables 2861
DECLARE @processes TABLE (spid int, sql_handle binary(20))
DECLARE @querylist TABLE (spid int, sql_handle binary(20), text nvarchar(2000))
DECLARE @sql_handle binary(20),
@spid int
@IsmaelJCarlo
IsmaelJCarlo / Compare-Target-ProxyAddresses.ps1
Last active August 29, 2015 14:13
Compare-Target-ProxyAddresses
#NOTE: Run in Exchnage Management Shell!!
function Compare-Target-ProxyAddresses ([object[]]$contacts) {
foreach ($contact in $contacts) {
$pfound = $false
foreach ($p in $contact.proxyaddresses) { if ($p -eq $contact.targetAddress -and $p -like "SMTP:*") { $pfound = $true } }
#if ($pfound -eq $true) { Write-Host "$($contact.targetAddress) is valid" } else { Write-Host "$($contact.targetAddress) is not valid" -backgroundcolor yellow -ForegroundColor black }
if ($pfound -eq $false) { Write-Host "$($contact.targetAddress) is not valid" -ForegroundColor red }
}
}
@IsmaelJCarlo
IsmaelJCarlo / PSMap-Network-Drive
Created January 6, 2015 16:43
PSMap-Network-Drive
$response = Read-host "Please enter your password." -AsSecureString
$password = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($response)
$user = ""
$Drive = "X:"
$UNC = ""
cls
# if the drive exists remove it
@IsmaelJCarlo
IsmaelJCarlo / Exchange Management Shell Import-Module ActiveDirectory Error
Created November 19, 2014 16:24
Exchange Management Shell Import-Module ActiveDirectory Error
[PS] C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Exchange Server 2010>import-module activedirectory
import-module : The 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\activedirectory\activedirectory.psd1' module ca
nnot be imported because its manifest contains one or more members that are not valid. The valid manifest members are (
'ModuleToProcess', 'NestedModules', 'GUID', 'Author', 'CompanyName', 'Copyright', 'ModuleVersion', 'Description', 'Powe
rShellVersion', 'PowerShellHostName', 'PowerShellHostVersion', 'CLRVersion', 'DotNetFrameworkVersion', 'ProcessorArchit
ecture', 'RequiredModules', 'TypesToProcess', 'FormatsToProcess', 'ScriptsToProcess', 'PrivateData', 'RequiredAssemblie
s', 'ModuleList', 'FileList', 'FunctionsToExport', 'VariablesToExport', 'AliasesToExport', 'CmdletsToExport'). Remove t
he members that are not valid ('HelpInfoUri'), then try to import the module again.
At line:1 char:14
+ import-module <<<< activedirectory
@IsmaelJCarlo
IsmaelJCarlo / sql-format-number
Created June 6, 2014 15:41
Formats a number to human readable text with commas
CREATE FUNCTION dbo.CommaFormat(@num float)
RETURNS varchar(256)
WITH EXECUTE AS CALLER
AS
BEGIN
DECLARE @formattedNum varchar(256)
SELECT @formattedNum = CONVERT(varchar(256), CAST(@num AS money), 1)
SELECT @formattedNum = REPLACE(@formattedNum,'.00','')
RETURN (@formattedNum)
@IsmaelJCarlo
IsmaelJCarlo / Get-MacAdress-From-IP
Created June 6, 2014 15:35
Gets a MAC Address from an IP Address
function Get-MacAddress {
param( [string]$device= $( throw "Please specify device" ) )
if ( $device | ? { $_ -match "[0-9].[0-9].[0-9].[0-9]" } )
{
#"Searching by IP Address"
$ip = $device